Skip to content

Commit

Permalink
staging: brcm80211: Fix memory leak after kmalloc failure
Browse files Browse the repository at this point in the history
This error was spotted by cppcheck:

drivers/staging/brcm80211/phy/wlc_phy_lcn.c:4053: error: Memory leak: ptr

Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: linux-wireless@vger.kernel.org
Cc: devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Stefan Weil authored and Greg Kroah-Hartman committed Mar 1, 2011
1 parent 8d9e9d0 commit 2d586ea
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_lcn.c
Original file line number Diff line number Diff line change
Expand Up @@ -4051,6 +4051,7 @@ wlc_lcnphy_a1(phy_info_t *pi, int cal_type, int num_levels, int step_size_lg2)

phy_c32 = kmalloc(sizeof(u16) * 20, GFP_ATOMIC);
if (NULL == phy_c32) {
kfree(ptr);
return;
}
phy_c26 = read_phy_reg(pi, 0x6da);
Expand Down

0 comments on commit 2d586ea

Please sign in to comment.