diff options
author | Bernard Zhao <bernard@vivo.com> | 2020-11-01 18:31:21 -0800 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2020-11-12 11:24:01 +0100 |
commit | 030a48b0f6ce393d78b8d33debb1e2043b8cc156 (patch) | |
tree | ed33ab3486f1625b282093aa38a4d6aa903b3818 /drivers/thermal/thermal_hwmon.c | |
parent | e01aac535353e013f9a5c9675232458906b895da (diff) | |
download | lwn-030a48b0f6ce393d78b8d33debb1e2043b8cc156.tar.gz lwn-030a48b0f6ce393d78b8d33debb1e2043b8cc156.zip |
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
Diffstat (limited to 'drivers/thermal/thermal_hwmon.c')
-rw-r--r-- | drivers/thermal/thermal_hwmon.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c index 8b92e00ff236..ad03262cca56 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; } |