From: Lukasz Majewski <l.majewski@samsung.com>
To: Eduardo Valentin <edubezval@gmail.com>
Cc: Zhang Rui <rui.zhang@intel.com>,
Linux PM list <linux-pm@vger.kernel.org>,
"linux-samsung-soc@vger.kernel.org"
<linux-samsung-soc@vger.kernel.org>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Lukasz Majewski <l.majewski@majess.pl>,
Abhilash Kesavan <kesavan.abhilash@gmail.com>,
Abhilash Kesavan <a.kesavan@samsung.com>,
Chanwoo Choi <cw00.choi@samsung.com>,
Lukasz Majewski <l.majewski@samsung.com>
Subject: [PATCH] thermal: exynos: fix: Check if data->tmu_read callback is present before read
Date: Fri, 06 Feb 2015 14:07:10 +0100 [thread overview]
Message-ID: <1423228030-18708-1-git-send-email-l.majewski@samsung.com> (raw)
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
next reply other threads:[~2015-02-06 13:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-06 13:07 Lukasz Majewski [this message]
2015-02-16 9:53 ` [PATCH] thermal: exynos: fix: Check if data->tmu_read callback is present before read Lukasz Majewski
2015-02-19 12:23 ` Abhilash Kesavan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1423228030-18708-1-git-send-email-l.majewski@samsung.com \
--to=l.majewski@samsung.com \
--cc=a.kesavan@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=cw00.choi@samsung.com \
--cc=edubezval@gmail.com \
--cc=kesavan.abhilash@gmail.com \
--cc=l.majewski@majess.pl \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox