[PATCH] Input: Fix oops caused by missing null test

From: Henrik Rydberg
Date: Thu Sep 13 2012 - 02:59:40 EST


Found in linux-next on September 12, thanks Sedat.

Reported-by: Sedat Dilek <sedat.dilek@xxxxxxxxx>
Signed-off-by: Henrik Rydberg <rydberg@xxxxxxxxxxx>
---
drivers/input/input.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/input.c b/drivers/input/input.c
index 5b66b2f..2dff71b 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -114,7 +114,7 @@ static unsigned int input_to_handler(struct input_handle *handle,

if (handler->events)
handler->events(handle, vals, count);
- else
+ else if (handler->event)
for (v = vals; v != end; v++)
handler->event(handle, v->type, v->code, v->value);

--
1.7.12

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/