Commit 8759f904 authored by Jean Delvare's avatar Jean Delvare Committed by Guenter Roeck

hwmon: (emc1403) Fix resource leak on module unload

Commit 454aee17 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: default avatarJean Delvare <jdelvare@suse.de>
Fixes: 454aee17 hwmon: (emc1403) Convert to use devm_hwmon_device_register_with_groups
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org [3.13+]
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 17c048fc
...@@ -355,9 +355,9 @@ static int emc1403_probe(struct i2c_client *client, ...@@ -355,9 +355,9 @@ static int emc1403_probe(struct i2c_client *client,
if (id->driver_data) if (id->driver_data)
data->groups[1] = &emc1404_group; data->groups[1] = &emc1404_group;
hwmon_dev = hwmon_device_register_with_groups(&client->dev, hwmon_dev = devm_hwmon_device_register_with_groups(&client->dev,
client->name, data, client->name, data,
data->groups); data->groups);
if (IS_ERR(hwmon_dev)) if (IS_ERR(hwmon_dev))
return PTR_ERR(hwmon_dev); return PTR_ERR(hwmon_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment