public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal: exynos: fix: Check if data->tmu_read callback is present before read
@ 2015-02-06 13:07 Lukasz Majewski
  2015-02-16  9:53 ` Lukasz Majewski
  0 siblings, 1 reply; 3+ messages in thread
From: Lukasz Majewski @ 2015-02-06 13:07 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Zhang Rui, Linux PM list, linux-samsung-soc@vger.kernel.org,
	Bartlomiej Zolnierkiewicz, Lukasz Majewski, Abhilash Kesavan,
	Abhilash Kesavan, Chanwoo Choi, Lukasz Majewski

The exynos_tmu_data() function should on entrance test not only for valid
data pointer, but also for data->tmu_read one.
It is important, since afterwards it is dereferenced to get temperature code.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
---
 drivers/thermal/samsung/exynos_tmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 3a19353..a86e0495e 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -717,7 +717,7 @@ static int exynos_get_temp(void *p, long *temp)
 {
 	struct exynos_tmu_data *data = p;
 
-	if (!data)
+	if (!data || !data->tmu_read)
 		return -EINVAL;
 
 	mutex_lock(&data->lock);
-- 
2.0.0.rc2

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

end of thread, other threads:[~2015-02-19 12:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-06 13:07 [PATCH] thermal: exynos: fix: Check if data->tmu_read callback is present before read Lukasz Majewski
2015-02-16  9:53 ` Lukasz Majewski
2015-02-19 12:23   ` Abhilash Kesavan

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