From 0effaeb1474916894b869b492f8610e86d3a94a9 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Thu, 30 Jun 2011 02:30:03 -0700 Subject: [PATCH] --- yaml --- r: 254274 b: refs/heads/master c: 3b33ca41227a54a78446fb0d7a6fdb9862f563db h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/hwmon/adm1275.c | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index b241bb040216..b6790031cdfa 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7f2c0662e5cfd05f12ca49109e8f787bf2d87b66 +refs/heads/master: 3b33ca41227a54a78446fb0d7a6fdb9862f563db diff --git a/trunk/drivers/hwmon/adm1275.c b/trunk/drivers/hwmon/adm1275.c index c2ee2048ab91..b9b7caf4a1d2 100644 --- a/trunk/drivers/hwmon/adm1275.c +++ b/trunk/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)