staging: brcm80211: minor cleanup in initvars_srom_pci()
authorArend van Spriel <arend@broadcom.com>
Wed, 29 Jun 2011 23:46:28 +0000 (16:46 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 5 Jul 2011 16:57:09 +0000 (09:57 -0700)
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>
drivers/staging/brcm80211/brcmsmac/srom.c

index 5b5306a..31aa84d 100644 (file)
@@ -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;
 }