compal-laptop: Fix leaking hwmon device
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>
Thu, 12 Mar 2015 07:43:59 +0000 (08:43 +0100)
committerSasha Levin <sasha.levin@oracle.com>
Sun, 17 May 2015 23:11:54 +0000 (19:11 -0400)
commit29037bcf2d8bf828d253a2e31339c3c04a172a9c
tree22c827eacca8b3a8643e8e6c6c4b1c3883b4b835
parent502e02465516f6987e89b564051d82a9b6498377
compal-laptop: Fix leaking hwmon device

[ Upstream commit ad774702f1705c04e5fa492b793d8d477a504fa6 ]

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")
Cc: <stable@vger.kernel.org>
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: Sasha Levin <sasha.levin@oracle.com>
drivers/platform/x86/compal-laptop.c