aboutsummaryrefslogtreecommitdiff
path: root/drivers/hwmon/ibmaem.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-08-13 18:37:28 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-08-13 18:37:28 -0700
commit91d85ea6786107aa2837bef3e957165ad7c8b823 (patch)
treec6100fd49a1c3d961998c3c89e706de4ceafb97e /drivers/hwmon/ibmaem.c
parent17987783e51555da22890feb715a0c84d4ed36aa (diff)
parent66a89b2164e2d30661edbd1953eacf0594d8203a (diff)
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging: hwmon: (ibmaem) add missing kfree hwmon: (pmbus/lm25066) Ignore byte writes to non-zero pages hwmon: (pmbus) Virtualize pmbus_write_byte
Diffstat (limited to 'drivers/hwmon/ibmaem.c')
-rw-r--r--drivers/hwmon/ibmaem.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c
index 1a409c5bc9b..c316294c48b 100644
--- a/drivers/hwmon/ibmaem.c
+++ b/drivers/hwmon/ibmaem.c
@@ -432,13 +432,15 @@ static int aem_read_sensor(struct aem_data *data, u8 elt, u8 reg,
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) {
@@ -463,8 +465,11 @@ static int aem_read_sensor(struct aem_data *data, u8 elt, u8 reg,
break;
}
}
+ res = 0;
- return 0;
+out:
+ kfree(rs_resp);
+ return res;
}
/* Update AEM energy registers */