public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal: ti-soc-thermal: fix error check
@ 2015-11-23 12:54 Sudip Mukherjee
  2015-11-23 23:25 ` Eduardo Valentin
  0 siblings, 1 reply; 3+ messages in thread
From: Sudip Mukherjee @ 2015-11-23 12:54 UTC (permalink / raw)
  To: Eduardo Valentin, Zhang Rui; +Cc: linux-kernel, linux-pm, Sudip Mukherjee

We were only checking if data is not NULL but
ti_bandgap_get_sensor_data() can return NULL or ERR_PTR.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index b213a12..d76bb7c 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -365,7 +365,7 @@ int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id)
 
 	data = ti_bandgap_get_sensor_data(bgp, id);
 
-	if (data && data->ti_thermal) {
+	if (!IS_ERR_OR_NULL(data) && data->ti_thermal) {
 		if (data->our_zone)
 			thermal_zone_device_unregister(data->ti_thermal);
 		else
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-24  7:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-23 12:54 [PATCH] thermal: ti-soc-thermal: fix error check Sudip Mukherjee
2015-11-23 23:25 ` Eduardo Valentin
2015-11-24  7:42   ` Sudip Mukherjee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox