Commit 3d489ac0 authored by Guenter Roeck's avatar Guenter Roeck Committed by Jean Delvare

hwmon: (lm90) Unregister hwmon device if interrupt setup fails

Commit 109b1283 (hwmon: (lm90) Add support to handle IRQ) introduced
interrupt support. Its error handling code fails to unregister the already
registered hwmon device.

Fixes: 109b1283Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent 9538e100
...@@ -1610,12 +1610,14 @@ static int lm90_probe(struct i2c_client *client, ...@@ -1610,12 +1610,14 @@ static int lm90_probe(struct i2c_client *client,
"lm90", client); "lm90", client);
if (err < 0) { if (err < 0) {
dev_err(dev, "cannot request IRQ %d\n", client->irq); dev_err(dev, "cannot request IRQ %d\n", client->irq);
goto exit_remove_files; goto exit_unregister;
} }
} }
return 0; return 0;
exit_unregister:
hwmon_device_unregister(data->hwmon_dev);
exit_remove_files: exit_remove_files:
lm90_remove_files(client, data); lm90_remove_files(client, data);
exit_restore: exit_restore:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment