OSDN Git Service

compal-laptop: Fix leaking hwmon device
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>
Thu, 12 Mar 2015 07:43:59 +0000 (08:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2015 20:03:44 +0000 (22:03 +0200)
commit855715fa0e283d4ff8280c79ac2c531116bc3290
tree91af031f80a7ec50e488084c76d39882cd7bda93
parent721669bff3eaa852476783845293dca50431ce5b
compal-laptop: Fix leaking hwmon device

commit ad774702f1705c04e5fa492b793d8d477a504fa6 upstream.

The commit c2be45f09bb0 ("compal-laptop: Use
devm_hwmon_device_register_with_groups") wanted to change the
registering of hwmon device to resource-managed version. It mostly did
it except the main thing - it forgot to use devm-like function so the
hwmon device leaked after device removal or probe failure.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: c2be45f09bb0 ("compal-laptop: Use devm_hwmon_device_register_with_groups")
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/platform/x86/compal-laptop.c