thermal/drivers/k3_j72xx_bandgap: Fix ref_table memory leak during probe
authorBryan Brattlof <bb@ti.com>
Wed, 25 May 2022 21:36:17 +0000 (16:36 -0500)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 28 Jul 2022 15:29:47 +0000 (17:29 +0200)
commit99a049aace3257cf7644c3bbf67cb1a655248cc2
treed0bb3937888bb2f2224f69ad8353c32b389276d2
parent4102c4042a33c682021683ec26c2dca3fd9d7cc2
thermal/drivers/k3_j72xx_bandgap: Fix ref_table memory leak during probe

If an error occurs in the k3_j72xx_bandgap_probe() function the memory
allocated to the 'ref_table' will not be released.

Add a err_free_ref_table step to the error path to free 'ref_table'

Fixes: 72b3fc61c752 ("thermal: k3_j72xx_bandgap: Add the bandgap driver support")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Keerthy <j-keerthy@ti.com>
Link: https://lore.kernel.org/r/20220525213617.30002-1-bb@ti.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/k3_j72xx_bandgap.c