* [PATCH] thermal: ti-soc-thermal: Fix ti_thermal_unregister_cpu_cooling NULL pointer on unload
@ 2017-10-16 21:07 Tony Lindgren
2017-10-18 3:49 ` Keerthy
0 siblings, 1 reply; 2+ messages in thread
From: Tony Lindgren @ 2017-10-16 21:07 UTC (permalink / raw)
To: Eduardo Valentin, Zhang Rui; +Cc: linux-pm, linux-omap, Keerthy
While debugging some PM issues and trying to remove all the loaded modules, I ran
across the following when unloading ti-soc-thermal:
Unable to handle kernel NULL pointer dereference at virtual address 000000b4
...
[<c08db340>] (kobject_put) from [<bf28954c>] (ti_thermal_unregister_cpu_cooling+0x20/0x28 [ti_soc_thermal])
[<bf28954c>] (ti_thermal_unregister_cpu_cooling [ti_soc_thermal]) from [<bf287c88>] (ti_bandgap_remove+0x3c/0x104 [ti_soc_thermal])
[<bf287c88>] (ti_bandgap_remove [ti_soc_thermal]) from [<c0610d48>] (platform_drv_remove+0x24/0x3c)
[<c0610d48>] (platform_drv_remove) from [<c060f114>] (device_release_driver_internal+0x160/0x208)
[<c060f114>] (device_release_driver_internal) from [<c060f200>] (driver_detach+0x38/0x6c)
[<c060f200>] (driver_detach) from [<c060e2d4>] (bus_remove_driver+0x4c/0xa0)
[<c060e2d4>] (bus_remove_driver) from [<c01f2370>] (SyS_delete_module+0x168/0x238)
[<c01f2370>] (SyS_delete_module) from [<c0108240>] (ret_fast_syscall+0x0/0x28)
Cc: Keerthy <j-keerthy@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -278,7 +278,8 @@ int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id)
if (data) {
cpufreq_cooling_unregister(data->cool_dev);
- cpufreq_cpu_put(data->policy);
+ if (data->policy)
+ cpufreq_cpu_put(data->policy);
}
return 0;
--
2.14.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] thermal: ti-soc-thermal: Fix ti_thermal_unregister_cpu_cooling NULL pointer on unload
2017-10-16 21:07 [PATCH] thermal: ti-soc-thermal: Fix ti_thermal_unregister_cpu_cooling NULL pointer on unload Tony Lindgren
@ 2017-10-18 3:49 ` Keerthy
0 siblings, 0 replies; 2+ messages in thread
From: Keerthy @ 2017-10-18 3:49 UTC (permalink / raw)
To: Tony Lindgren, Eduardo Valentin, Zhang Rui; +Cc: linux-pm, linux-omap
On Tuesday 17 October 2017 02:37 AM, Tony Lindgren wrote:
> While debugging some PM issues and trying to remove all the loaded modules, I ran
> across the following when unloading ti-soc-thermal:
>
> Unable to handle kernel NULL pointer dereference at virtual address 000000b4
> ...
> [<c08db340>] (kobject_put) from [<bf28954c>] (ti_thermal_unregister_cpu_cooling+0x20/0x28 [ti_soc_thermal])
> [<bf28954c>] (ti_thermal_unregister_cpu_cooling [ti_soc_thermal]) from [<bf287c88>] (ti_bandgap_remove+0x3c/0x104 [ti_soc_thermal])
> [<bf287c88>] (ti_bandgap_remove [ti_soc_thermal]) from [<c0610d48>] (platform_drv_remove+0x24/0x3c)
> [<c0610d48>] (platform_drv_remove) from [<c060f114>] (device_release_driver_internal+0x160/0x208)
> [<c060f114>] (device_release_driver_internal) from [<c060f200>] (driver_detach+0x38/0x6c)
> [<c060f200>] (driver_detach) from [<c060e2d4>] (bus_remove_driver+0x4c/0xa0)
> [<c060e2d4>] (bus_remove_driver) from [<c01f2370>] (SyS_delete_module+0x168/0x238)
> [<c01f2370>] (SyS_delete_module) from [<c0108240>] (ret_fast_syscall+0x0/0x28)
Acked-by: Keerthy <j-keerthy@ti.com>
>
> Cc: Keerthy <j-keerthy@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> @@ -278,7 +278,8 @@ int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id)
>
> if (data) {
> cpufreq_cooling_unregister(data->cool_dev);
> - cpufreq_cpu_put(data->policy);
> + if (data->policy)
> + cpufreq_cpu_put(data->policy);
> }
>
> return 0;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-18 3:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-16 21:07 [PATCH] thermal: ti-soc-thermal: Fix ti_thermal_unregister_cpu_cooling NULL pointer on unload Tony Lindgren
2017-10-18 3:49 ` Keerthy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).