Skip to content

Commit

Permalink
staging: brcm80211: minor cleanup in initvars_srom_pci()
Browse files Browse the repository at this point in the history
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: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Arend van Spriel authored and Greg Kroah-Hartman committed Jul 5, 2011
1 parent fb10e59 commit fa0ace7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/staging/brcm80211/brcmsmac/srom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,12 +1287,10 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
*vp++ = '\0';

err = initvars_table(base, vp, vars, count);
kfree(base);
}

errout:
if (base)
kfree(base);

kfree(srom);
return err;
}

0 comments on commit fa0ace7

Please sign in to comment.