linux/drivers/thermal/broadcom
Daniel Lezcano 8454c8c09c thermal/drivers/bcm2835: Remove buggy call to thermal_of_zone_unregister
The driver is using the devm_thermal_of_zone_device_register().

In the error path of the function calling
devm_thermal_of_zone_device_register(), the function
devm_thermal_of_zone_unregister() should be called instead of
thermal_of_zone_unregister(), otherwise this one will be called twice
when the device is freed.

The same happens for the remove function where the devm_ guarantee the
thermal_of_zone_unregister() will be called, so adding this call in
the remove function will lead to a double free also.

Use devm_ variant in the error path of the probe function.

Remove thermal_of_zone_unregister() in the remove function.

Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Ray Jui <rjui@broadcom.com>
Cc: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20230404075138.2914680-1-daniel.lezcano@linaro.org
2023-04-07 18:36:28 +02:00
..
bcm2711_thermal.c thermal/hwmon: Do not set no_hwmon before calling thermal_add_hwmon_sysfs() 2023-03-03 20:45:02 +01:00
bcm2835_thermal.c thermal/drivers/bcm2835: Remove buggy call to thermal_of_zone_unregister 2023-04-07 18:36:28 +02:00
brcmstb_thermal.c thermal: Remove debug or error messages in get_temp() ops 2023-03-03 20:45:02 +01:00
Kconfig thermal: Add BCM2711 thermal driver 2020-01-27 11:41:08 +01:00
Makefile thermal: Add BCM2711 thermal driver 2020-01-27 11:41:08 +01:00
ns-thermal.c thermal/core: Use the thermal zone 'devdata' accessor in thermal located drivers 2023-03-03 20:45:02 +01:00
sr-thermal.c thermal/core: Use the thermal zone 'devdata' accessor in thermal located drivers 2023-03-03 20:45:02 +01:00