]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.19.7/compal-laptop-fix-leaking-hwmon-device.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.19.7 / compal-laptop-fix-leaking-hwmon-device.patch
1 From ad774702f1705c04e5fa492b793d8d477a504fa6 Mon Sep 17 00:00:00 2001
2 From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
3 Date: Thu, 12 Mar 2015 08:43:59 +0100
4 Subject: compal-laptop: Fix leaking hwmon device
5
6 From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7
8 commit ad774702f1705c04e5fa492b793d8d477a504fa6 upstream.
9
10 The commit c2be45f09bb0 ("compal-laptop: Use
11 devm_hwmon_device_register_with_groups") wanted to change the
12 registering of hwmon device to resource-managed version. It mostly did
13 it except the main thing - it forgot to use devm-like function so the
14 hwmon device leaked after device removal or probe failure.
15
16 Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
17 Fixes: c2be45f09bb0 ("compal-laptop: Use devm_hwmon_device_register_with_groups")
18 Acked-by: Guenter Roeck <linux@roeck-us.net>
19 Acked-by: Darren Hart <dvhart@linux.intel.com>
20 Signed-off-by: Sebastian Reichel <sre@kernel.org>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22
23 ---
24 drivers/platform/x86/compal-laptop.c | 6 +++---
25 1 file changed, 3 insertions(+), 3 deletions(-)
26
27 --- a/drivers/platform/x86/compal-laptop.c
28 +++ b/drivers/platform/x86/compal-laptop.c
29 @@ -1026,9 +1026,9 @@ static int compal_probe(struct platform_
30 if (err)
31 return err;
32
33 - hwmon_dev = hwmon_device_register_with_groups(&pdev->dev,
34 - "compal", data,
35 - compal_hwmon_groups);
36 + hwmon_dev = devm_hwmon_device_register_with_groups(&pdev->dev,
37 + "compal", data,
38 + compal_hwmon_groups);
39 if (IS_ERR(hwmon_dev)) {
40 err = PTR_ERR(hwmon_dev);
41 goto remove;