提交 fa0ace7f 编写于 作者: A Arend van Spriel 提交者: Greg Kroah-Hartman

staging: brcm80211: minor cleanup in initvars_srom_pci()

The error handling code labelled with errout: did a conditional kfree(). The
last error jump to the label is upon failure of the kmalloc() for which the
conditional kfree() is done. Therefor, the kfree is moved before the error
label and done unconditionally.
Signed-off-by: NArend van Spriel <arend@broadcom.com>
Reviewed-by: NRoland Vossen <rvossen@broadcom.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 fb10e591
...@@ -1287,12 +1287,10 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars, ...@@ -1287,12 +1287,10 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
*vp++ = '\0'; *vp++ = '\0';
err = initvars_table(base, vp, vars, count); err = initvars_table(base, vp, vars, count);
kfree(base);
} }
errout: errout:
if (base)
kfree(base);
kfree(srom); kfree(srom);
return err; return err;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册