Skip to contentSkip to conversation

hwmon: (emc1403) Fix resource leak on module unload

PATCH In review Jean Delvare 2 participants 2 messages May 12, 2014 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

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.

Fixes 454aee17f hwmon: (emc1403) Convert to use devm_hwmon_device_register_with_groups
Cc Guenter Roeck <[email protected]>
---
 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_clie
 	if (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
maintainer
#1 lore raw
Quoted 6 lines · Jean Delvare

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.

Oops ....

Quoted 4 lines
Fixes 454aee17f hwmon: (emc1403) Convert to use devm_hwmon_device_register_with_groups
Cc Guenter Roeck <[email protected]>

Thanks, I'll apply and send to Linus.

Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors