summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-12-12 11:05:32 +0400
committerJean Delvare <khali@endymion.delvare>2013-12-12 11:05:32 +0400
commit3d489ac07ed85c4908d864abb77ab1e6f94e0e4b (patch)
tree378baa783a7cba54e125f2b1d5f13b277a7fd25c /drivers
parent9538e10086bd1301fe915683b1ba0a1de66d7483 (diff)
downloadlinux-3d489ac07ed85c4908d864abb77ab1e6f94e0e4b.tar.xz
hwmon: (lm90) Unregister hwmon device if interrupt setup fails
Commit 109b1283fb (hwmon: (lm90) Add support to handle IRQ) introduced interrupt support. Its error handling code fails to unregister the already registered hwmon device. Fixes: 109b1283fb532ac773a076748ffccf76a7067cab Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/lm90.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index 4c4c1421bf28..8b8f3aa49726 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -1610,12 +1610,14 @@ static int lm90_probe(struct i2c_client *client,
"lm90", client);
if (err < 0) {
dev_err(dev, "cannot request IRQ %d\n", client->irq);
- goto exit_remove_files;
+ goto exit_unregister;
}
}
return 0;
+exit_unregister:
+ hwmon_device_unregister(data->hwmon_dev);
exit_remove_files:
lm90_remove_files(client, data);
exit_restore: