On Wed, Apr 19, 2017 at 8:03 AM, Wolfgang Bumiller <w.bumil...@proxmox.com> wrote: >> On April 19, 2017 at 1:32 PM Jamal Hadi Salim <j...@mojatatu.com> wrote: >> My suggestion: >> If we move the cookie allocation before init we can save it and >> only when init succeeds do we attach it to the action, otherwise >> we free it on error path. > > Shouldn't the old code have freed an old a->act_cookie as well before > replacing it then? nla_memdup_cookie() starts off by assigning a->act_cookie. >
Yeah. Looks even better, we can totally avoid rollback the action modification rollback on failure.