hwmon: (lm90) Unregister hwmon device if interrupt setup fails
Subsystems (2)
Guenter Roeck
maintainerPATCH 1/3 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.
--- drivers/hwmon/lm90.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hwmon/lm90.c +3 -1
@@ -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:
Signature · 7 lines
1.7.9.7 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 21 lines · Guenter Roeck
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 109b1283fb532ac773a076748ffccf76a7067cabSigned-off-by Guenter Roeck <[email protected]>--- drivers/hwmon/lm90.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/hwmon/lm90.c +1
-1@@ -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;
drivers/hwmon/lm90.c static int lm90_probe(struct i2c_client *client, · line 1623
Quoted 10 lines
drivers/hwmon/lm90.c +2
-0} }return 0 ; +exit_unregister: +hwmon_device_unregister (data->hwmon_dev); exit_remove_files:lm90_remove_files (client, data); exit_restore:
Hi Jean,
please ignore the 1/3 in the headline. The other two patches are the conversion to hwmon_device_register_with_groups which I'll need to test first.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Guenter,
Quoted 20 lines · Guenter Roeck
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 109b1283fb532ac773a076748ffccf76a7067cabSigned-off-by Guenter Roeck <[email protected]>--- drivers/hwmon/lm90.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/hwmon/lm90.c +1
-1@@ -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;
drivers/hwmon/lm90.c static int lm90_probe(struct i2c_client *client, · line 1623
Quoted 10 lines
drivers/hwmon/lm90.c +2
-0} }return 0 ; +exit_unregister: +hwmon_device_unregister (data->hwmon_dev); exit_remove_files:lm90_remove_files (client, data); exit_restore:
Good catch, thanks for reporting and sorry for missing this during my code review. Applied.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors