From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
Julia Lawall <julia@diku.dk>,
Guenter Roeck <guenter.roeck@ericsson.com>
Subject: [07/20] hwmon: (ibmaem) add missing kfree
Date: Fri, 26 Aug 2011 15:03:30 -0700 [thread overview]
Message-ID: <20110826220419.552313708@clark.kroah.org> (raw)
In-Reply-To: <20110826220431.GA15382@kroah.com>
2.6.33-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Julia Lawall <julia@diku.dk>
commit 66a89b2164e2d30661edbd1953eacf0594d8203a upstream.
rs_resp is dynamically allocated in aem_read_sensor(), so it should be freed
before exiting in every case. This collects the kfree and the return at
the end of the function.
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/hwmon/ibmaem.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
--- a/drivers/hwmon/ibmaem.c
+++ b/drivers/hwmon/ibmaem.c
@@ -429,13 +429,15 @@ static int aem_read_sensor(struct aem_da
aem_send_message(ipmi);
res = wait_for_completion_timeout(&ipmi->read_complete, IPMI_TIMEOUT);
- if (!res)
- return -ETIMEDOUT;
+ if (!res) {
+ res = -ETIMEDOUT;
+ goto out;
+ }
if (ipmi->rx_result || ipmi->rx_msg_len != rs_size ||
memcmp(&rs_resp->id, &system_x_id, sizeof(system_x_id))) {
- kfree(rs_resp);
- return -ENOENT;
+ res = -ENOENT;
+ goto out;
}
switch (size) {
@@ -460,8 +462,11 @@ static int aem_read_sensor(struct aem_da
break;
}
}
+ res = 0;
- return 0;
+out:
+ kfree(rs_resp);
+ return res;
}
/* Update AEM energy registers */
next prev parent reply other threads:[~2011-08-27 14:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-26 22:04 [00/20] 2.6.33.19-longterm review Greg KH
2011-08-26 22:03 ` [01/20] staging: rtl8192u: declare MODULE_FIRMWARE Greg KH
2011-08-26 22:03 ` [02/20] USB: xhci: fix OS want to own HC Greg KH
2011-08-26 22:03 ` [03/20] USB: assign instead of equal in usbtmc.c Greg KH
2011-08-26 22:03 ` [04/20] USB: usb-storage: unusual_devs entry for ARM V2M motherboard Greg KH
2011-08-26 22:03 ` [05/20] USB: Serial: Added device ID for Qualcomm Modem in Sagemcom's HiLo3G Greg KH
2011-08-26 22:03 ` [06/20] atm: br2864: sent packets truncated in VC routed mode Greg KH
2011-08-26 22:03 ` Greg KH [this message]
2011-08-26 22:03 ` [08/20] ALSA: snd-usb-caiaq: Correct offset fields of outbound iso_frame_desc Greg KH
2011-08-26 22:03 ` [09/20] mm: fix wrong vmap address calculations with odd NR_CPUS values Greg KH
2011-08-26 22:03 ` [10/20] perf tools: do not look at ./config for configuration Greg KH
2011-08-26 22:03 ` [11/20] fs/partitions/efi.c: corrupted GUID partition tables can cause kernel oops Greg KH
2011-08-26 22:03 ` [12/20] befs: Validate length of long symbolic links Greg KH
2011-08-26 22:03 ` [13/20] ALSA: snd_usb_caiaq: track submitted output urbs Greg KH
2011-08-26 22:03 ` [14/20] ALSA: ac97: Add HP Compaq dc5100 SFF(PT003AW) to Headphone Jack Sense whitelist Greg KH
2011-08-26 22:03 ` [15/20] futex: Fix regression with read only mappings Greg KH
2011-08-26 22:03 ` [16/20] x86-32, vdso: On system call restart after SYSENTER, use int $0x80 Greg KH
2011-08-26 22:03 ` [17/20] x86, UV: Remove UV delay in starting slave cpus Greg KH
2011-08-26 22:03 ` [18/20] drm/ttm: fix ttm_bo_add_ttm(user) failure path Greg KH
2011-08-26 22:03 ` [19/20] fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message Greg KH
2011-08-26 22:03 ` [20/20] igb: Fix lack of flush after register write and before delay 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=20110826220419.552313708@clark.kroah.org \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=guenter.roeck@ericsson.com \
--cc=julia@diku.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=stable-review@kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
/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
all inboxes | Powered by JetHome®