linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: cyttsp4 - fix potential NULL pointer dereference in cyttsp4_watchdog_timer()
@ 2013-08-26  4:55 Wei Yongjun
  2013-08-26  5:26 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2013-08-26  4:55 UTC (permalink / raw)
  To: javier, dmitry.torokhov, fery; +Cc: yongjun_wei, linux-input

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

The dereference should be moved below the NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/input/touchscreen/cyttsp4_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/cyttsp4_core.c b/drivers/input/touchscreen/cyttsp4_core.c
index 963da05..ffa8e35 100644
--- a/drivers/input/touchscreen/cyttsp4_core.c
+++ b/drivers/input/touchscreen/cyttsp4_core.c
@@ -1244,11 +1244,11 @@ static void cyttsp4_watchdog_timer(unsigned long handle)
 {
 	struct cyttsp4 *cd = (struct cyttsp4 *)handle;
 
-	dev_vdbg(cd->dev, "%s: Watchdog timer triggered\n", __func__);
-
 	if (!cd)
 		return;
 
+	dev_vdbg(cd->dev, "%s: Watchdog timer triggered\n", __func__);
+
 	if (!work_pending(&cd->watchdog_work))
 		schedule_work(&cd->watchdog_work);
 


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

end of thread, other threads:[~2013-08-26  6:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-26  4:55 [PATCH] Input: cyttsp4 - fix potential NULL pointer dereference in cyttsp4_watchdog_timer() Wei Yongjun
2013-08-26  5:26 ` Dmitry Torokhov
2013-08-26  5:54   ` Ferruh Yigit

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).