Thread (3 messages) flat view 3 messages, 3 authors, 2013-08-26

Re: [PATCH] Input: cyttsp4 - fix potential NULL pointer dereference in cyttsp4_watchdog_timer()

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2013-08-26 05:26:13

Wei Yongjun [off-list ref] wrote:
quoted hunk ↗ jump to hunk
From: Wei Yongjun <redacted>

The dereference should be moved below the NULL test.

Signed-off-by: Wei Yongjun <redacted>
---
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;
Actually this test does not make any sense and we should rather remove it.
+	dev_vdbg(cd->dev, "%s: Watchdog timer triggered\n", __func__);
+
	if (!work_pending(&cd->watchdog_work))
		schedule_work(&cd->watchdog_work);
Hi Wei,
Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help