Skip to content

Commit

Permalink
thermal/drivers/hwmon: Cleanup coding style a bit
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Bernard Zhao authored and Daniel Lezcano committed Nov 12, 2020
1 parent e01aac5 commit 030a48b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/thermal/thermal_hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 030a48b

Please sign in to comment.