From: Greg Kroah-Hartman <gregkh@suse.de>
To: devel@linuxdriverproject.org
Cc: Stefan Weil <weil@mail.berlios.de>,
Brett Rudley <brudley@broadcom.com>,
Henry Ptasinski <henryp@broadcom.com>,
linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 584/961] staging: brcm80211: Fix memory leak after kmalloc failure
Date: Wed, 16 Mar 2011 14:03:47 -0700 [thread overview]
Message-ID: <1300309804-3756-584-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <1300309804-3756-1-git-send-email-gregkh@suse.de>
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
next prev parent reply other threads:[~2011-03-16 21:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-16 21:03 [GIT PATCH] STAGING patches for .39 Greg KH
[not found] ` <1300309804-3756-1-git-send-email-gregkh@suse.de>
2011-03-16 21:03 ` Greg Kroah-Hartman [this message]
2011-03-17 0:19 ` Linus Torvalds
2011-03-17 0:28 ` Greg KH
2011-03-17 0:32 ` Linus Torvalds
2011-03-17 0:34 ` Linus Torvalds
2011-03-17 1:52 ` Greg KH
2011-03-17 2:02 ` Greg KH
2011-03-17 19:55 ` Randy Dunlap
2011-03-17 20:04 ` Greg KH
2011-03-17 20:17 ` Randy Dunlap
2011-03-17 1:51 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1300309804-3756-584-git-send-email-gregkh@suse.de \
--to=gregkh@suse.de \
--cc=brudley@broadcom.com \
--cc=devel@driverdev.osuosl.org \
--cc=devel@linuxdriverproject.org \
--cc=henryp@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=weil@mail.berlios.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox