diff mbox series

[thermal:,thermal/next] thermal/drivers/hwmon: Cleanup coding style a bit

Message ID 160621059771.11115.1021341423442981344.tip-bot2@tip-bot2 (mailing list archive)
State Not Applicable, archived
Headers show
Series [thermal:,thermal/next] thermal/drivers/hwmon: Cleanup coding style a bit | expand

Commit Message

thermal-bot for Stanislaw Gruszka Nov. 24, 2020, 9:36 a.m. UTC
The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     030a48b0f6ce393d78b8d33debb1e2043b8cc156
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//030a48b0f6ce393d78b8d33debb1e2043b8cc156
Author:        Bernard Zhao <bernard@vivo.com>
AuthorDate:    Sun, 01 Nov 2020 18:31:21 -08:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Thu, 12 Nov 2020 11:24:01 +01:00

thermal/drivers/hwmon: Cleanup coding style a bit

Function thermal_add_hwmon_sysfs, hwmon will be NULL when
new_hwmon_device = 0, so there is no need to check, kfree will
handle NULL point.

Signed-off-by: Bernard Zhao <bernard@vivo.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20201102023121.3312-1-bernard@vivo.com
---
 drivers/thermal/thermal_hwmon.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c
index 8b92e00..ad03262 100644
--- a/drivers/thermal/thermal_hwmon.c
+++ b/drivers/thermal/thermal_hwmon.c
@@ -206,8 +206,7 @@  int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 	if (new_hwmon_device)
 		hwmon_device_unregister(hwmon->device);
  free_mem:
-	if (new_hwmon_device)
-		kfree(hwmon);
+	kfree(hwmon);
 
 	return result;
 }