hwmon: (emc1403) Fix resource leak on module unload
PATCH 1/1 hwmon: (emc1403) Fix resource leak on module unload
Commit 454aee17f claims to convert driver emc1403 to use devm_hwmon_device_register_with_groups, however the patch itself makes use of hwmon_device_register_with_groups instead. As the driver remove function was still dropped, the hwmon device is no longer unregistered on driver removal, leading to a resource leak.
--- drivers/hwmon/emc1403.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/hwmon/emc1403.c +3 -3
@@ -355,9 +355,9 @@ static int emc1403_probe(struct i2c_clieif (id->driver_data) data->groups[1 ] = &emc1404_group; - hwmon_dev =hwmon_device_register_with_groups (&client->dev, - client->name, data, - data->groups); + hwmon_dev =devm_hwmon_device_register_with_groups (&client->dev, + client->name, data, + data->groups);if (IS_ERR (hwmon_dev))return PTR_ERR (hwmon_dev);
Signature · 7 lines
Jean Delvare SUSE L3 Support _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 6 lines · Jean Delvare
Commit
454aee17fclaims to convert driver emc1403 to usedevm_hwmon_device_register_with_groups, however the patch itself makes use ofhwmon_device_register_with_groupsinstead. As the driver remove function was still dropped, the hwmon device is no longer unregistered on driver removal, leading to a resource leak.
Oops ....
Quoted 4 lines
Signed-off-by Jean Delvare <[email protected]>Fixes 454aee17f hwmon: (emc1403) Convert to use devm_hwmon_device_register_with_groupsCc Guenter Roeck <[email protected]>Cc [email protected] [3.13+]
Thanks, I'll apply and send to Linus.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors