* [PATCH 584/961] staging: brcm80211: Fix memory leak after kmalloc failure
[not found] ` <1300309804-3756-1-git-send-email-gregkh@suse.de>
@ 2011-03-16 21:03 ` Greg Kroah-Hartman
0 siblings, 0 replies; only message in thread
From: Greg Kroah-Hartman @ 2011-03-16 21:03 UTC (permalink / raw)
To: devel
Cc: Stefan Weil, Brett Rudley, Henry Ptasinski, linux-wireless, devel,
linux-kernel, Greg Kroah-Hartman
From: Stefan Weil <weil@mail.berlios.de>
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>
---
.../staging/brcm80211/brcmsmac/phy/wlc_phy_lcn.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_lcn.c
index 3fbbbb4..f027d50 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_lcn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_lcn.c
@@ -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);
--
1.7.4.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-03-16 21:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20110316210300.GA3311@kroah.com>
[not found] ` <1300309804-3756-1-git-send-email-gregkh@suse.de>
2011-03-16 21:03 ` [PATCH 584/961] staging: brcm80211: Fix memory leak after kmalloc failure Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).