[PATCH] hwmon: (emc1403) Fix resource leak on module unload

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Signed-off-by: Jean Delvare <jdelvare@xxxxxxx>
Fixes: 454aee17f hwmon: (emc1403) Convert to use devm_hwmon_device_register_with_groups
Cc: Guenter Roeck <linux@xxxxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx [3.13+]
---
 drivers/hwmon/emc1403.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-3.15-rc5.orig/drivers/hwmon/emc1403.c	2014-03-31 05:40:15.000000000 +0200
+++ linux-3.15-rc5/drivers/hwmon/emc1403.c	2014-05-12 10:48:29.300740205 +0200
@@ -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);
 


-- 
Jean Delvare
SUSE L3 Support

_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux