aboutsummaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2014-05-12 11:44:51 +0200
committerShow Liu <show.liu@linaro.org>2014-06-18 12:04:32 +0800
commitd6719c79c9d6650b2b73373d3fb7a43567d3fa47 (patch)
tree9d6994a1f62df0d820a8de4698f5b71d3fa9ea9b /drivers/hwmon
parent46ddf315013cbe237510b55aa10f7d2416572b13 (diff)
hwmon: (emc1403) Fix resource leak on module unload
commit 8759f9046550f463098148bf577ccd32cdb895e3 upstream. 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@suse.de> Fixes: 454aee17f hwmon: (emc1403) Convert to use devm_hwmon_device_register_with_groups Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/emc1403.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hwmon/emc1403.c b/drivers/hwmon/emc1403.c
index 61d89d6d58f..42a3cfcd15c 100644
--- a/drivers/hwmon/emc1403.c
+++ b/drivers/hwmon/emc1403.c
@@ -355,9 +355,9 @@ static int emc1403_probe(struct i2c_client *client,
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);