Skip to content

Commit

Permalink
staging: brcm80211: remove unnecessary null check
Browse files Browse the repository at this point in the history
kfree(NULL) is safe, and the rest of the cleanup should be done regardless
to make sure the state is consistent.

Signed-off-by: Henry Ptasinski <henryp@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Henry Ptasinski authored and Greg Kroah-Hartman committed Jul 5, 2011
1 parent 202a208 commit 521223a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -5567,11 +5567,9 @@ static void dhdsdio_release_malloc(dhd_bus_t *bus)
if (bus->dhd && bus->dhd->dongle_reset)
return;

if (bus->rxbuf) {
kfree(bus->rxbuf);
bus->rxctl = bus->rxbuf = NULL;
bus->rxlen = 0;
}
kfree(bus->rxbuf);
bus->rxctl = bus->rxbuf = NULL;
bus->rxlen = 0;

kfree(bus->databuf);
bus->databuf = NULL;
Expand Down

0 comments on commit 521223a

Please sign in to comment.