summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/adm1275.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-07-13 08:30:11 +0100
committerDave Airlie <airlied@redhat.com>2011-07-13 08:30:22 +0100
commitcf056edbbe70393faa6edd2b7859a14467910946 (patch)
treeca30ef021f12d1f06e18856a60f815ba63e78f60 /drivers/hwmon/adm1275.c
parent58b6542b50ded4243c26c251c0507e5f658642f6 (diff)
parent620917de59eeb934b9f8cf35cc2d95c1ac8ed0fc (diff)
downloadtalos-op-linux-cf056edbbe70393faa6edd2b7859a14467910946.tar.gz
talos-op-linux-cf056edbbe70393faa6edd2b7859a14467910946.zip
Merge 3.0-rc7 into drm-core-next
This pulls in all the drm fixes up to this point which are needed for some -next patches to work.
Diffstat (limited to 'drivers/hwmon/adm1275.c')
-rw-r--r--drivers/hwmon/adm1275.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/hwmon/adm1275.c b/drivers/hwmon/adm1275.c
index c2ee2048ab91..b9b7caf4a1d2 100644
--- a/drivers/hwmon/adm1275.c
+++ b/drivers/hwmon/adm1275.c
@@ -32,6 +32,7 @@ static int adm1275_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
int config;
+ int ret;
struct pmbus_driver_info *info;
if (!i2c_check_functionality(client->adapter,
@@ -43,8 +44,10 @@ static int adm1275_probe(struct i2c_client *client,
return -ENOMEM;
config = i2c_smbus_read_byte_data(client, ADM1275_PMON_CONFIG);
- if (config < 0)
- return config;
+ if (config < 0) {
+ ret = config;
+ goto err_mem;
+ }
info->pages = 1;
info->direct[PSC_VOLTAGE_IN] = true;
@@ -76,7 +79,14 @@ static int adm1275_probe(struct i2c_client *client,
else
info->func[0] |= PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT;
- return pmbus_do_probe(client, id, info);
+ ret = pmbus_do_probe(client, id, info);
+ if (ret)
+ goto err_mem;
+ return 0;
+
+err_mem:
+ kfree(info);
+ return ret;
}
static int adm1275_remove(struct i2c_client *client)
OpenPOWER on IntegriCloud