Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Bernard Zhao and committed by
Daniel Lezcano
030a48b0 e01aac53

+1 -2
+1 -2
drivers/thermal/thermal_hwmon.c
··· 206 206 if (new_hwmon_device) 207 207 hwmon_device_unregister(hwmon->device); 208 208 free_mem: 209 - if (new_hwmon_device) 210 - kfree(hwmon); 209 + kfree(hwmon); 211 210 212 211 return result; 213 212 }