diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2011-08-17 22:47:15 -0400 |
---|---|---|
committer | Nicolas Pitre <nicolas.pitre@linaro.org> | 2011-08-17 22:47:15 -0400 |
commit | dbf7603a92cd895b8c1017734bc30fd9a32fd933 (patch) | |
tree | 7e0e8c35d5db964ee43494a721dee3c486e4e458 /drivers/hwmon/ibmaem.c | |
parent | 044c31fdf80ed9d8e6bfb33913d085c3efc6febe (diff) | |
parent | d31bf2883542cd3414674238f94123bd1d9c0b9f (diff) |
Merge commit 'v3.0.3' into linaro-3.0linux-linaro-3.0-2011.08-0
Diffstat (limited to 'drivers/hwmon/ibmaem.c')
-rw-r--r-- | drivers/hwmon/ibmaem.c | 15 |
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 */ |