hwmon: (lm90) Unregister hwmon device if interrupt setup fails
Commit109b1283fb
(hwmon: (lm90) Add support to handle IRQ) introduced interrupt support. Its error handling code fails to unregister the already registered hwmon device. Fixes:109b1283fb
Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
This commit is contained in:
Родитель
9538e10086
Коммит
3d489ac07e
|
@ -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:
|
||||
|
|
Загрузка…
Ссылка в новой задаче