Skip to content

Commit

Permalink
hwmon: (tmp103) Fix resource leak bug in tmp103 temperature sensor dr…
Browse files Browse the repository at this point in the history
…iver

tmp103 temperature sensor driver registers with the hwmon framework by calling
hwmon_device_register_with_groups but does not have a .remove method to call
hwmon_device_unregister to unregister from the framework when the device is no
longer needed. Fix this by calling devm_hwmon_device_register_with_groups.

Signed-off-by: Sundar J Dev <sundarjayakumardev@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
sundarjdev authored and Guenter Roeck committed Sep 22, 2014
1 parent 0a0039a commit 4e66cd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwmon/tmp103.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static int tmp103_probe(struct i2c_client *client,
}

i2c_set_clientdata(client, regmap);
hwmon_dev = hwmon_device_register_with_groups(dev, client->name,
hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name,
regmap, tmp103_groups);
return PTR_ERR_OR_ZERO(hwmon_dev);
}
Expand Down

0 comments on commit 4e66cd1

Please sign in to comment.