Skip to content

Commit

Permalink
hwmon: (lm90) Unregister hwmon device if interrupt setup fails
Browse files Browse the repository at this point in the history
Commit 109b128 (hwmon: (lm90) Add support to handle IRQ) introduced
interrupt support. Its error handling code fails to unregister the already
registered hwmon device.

Fixes: 109b128
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
  • Loading branch information
Guenter Roeck authored and Jean Delvare committed Dec 12, 2013
1 parent 9538e10 commit 3d489ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/hwmon/lm90.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3d489ac

Please sign in to comment.