summaryrefslogtreecommitdiff
path: root/drivers/thermal/hisi_thermal.c
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2017-08-08 16:39:54 +0200
committerZhang Rui <rui.zhang@intel.com>2017-08-11 11:34:07 +0800
commit9d9ca1f9f04cf1d20427528cd3b3d05ebad47547 (patch)
tree70384f8f55ac24f69d766409c93b0aa4a58aac3b /drivers/thermal/hisi_thermal.c
parent6a6cd25b58dc8ce2fbded8dd83bfa7d48f06f97d (diff)
thermal: core: Fix resources release in error paths in thermal_zone_device_register()
Reorder error handling code in order to fix some resources leaks in some cases: - 'tz' would leak if 'thermal_zone_create_device_groups()' fails - memory allocated by 'thermal_zone_create_device_groups()' would leak if 'device_register()' fails With this patch, we now have 2 error handling paths: one before 'device_register()', and one after it. This is needed because some resources are released in 'thermal_release()'. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/hisi_thermal.c')
0 files changed, 0 insertions, 0 deletions