summaryrefslogtreecommitdiff
path: root/drivers/hwmon/ibmaem.c
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2011-08-19 16:42:01 -0700
committerJohn Stultz <john.stultz@linaro.org>2011-08-19 16:42:01 -0700
commit312effedac183148411c965e20a62e73f23979f6 (patch)
tree81e466e84e7a2ebe9ee53e5d0963dc2d3c3f7356 /drivers/hwmon/ibmaem.c
parentd3828df964e542533765b23f9a343657c7860e17 (diff)
parentdbf7603a92cd895b8c1017734bc30fd9a32fd933 (diff)
Merge branch 'upstream/linaro-3.0' into linaro-android-3.0linux-linaro-3.0-2011.08-0-android-1
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 */