projects/linux·commit 28a2a2e1

Input: allocate absinfo data when setting ABS capability

28a2a2e1 · Dmitry Torokhov <[email protected]> · 2013-12-26 17:44:29 -08:00

We need to make sure we allocate absinfo data when we are setting one of
EV_ABS/ABS_XXX capabilities, otherwise we may bomb when we try to emit this
event.

Rested-by: Paul Cercueil <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Commit
28a2a2e1aedbe2d8b2301e6e0e4e63f6e4177aca
Parents
2a4d8154

Changes

1 files changed · +4 −0

FileStatusAddDelContent
drivers/input/input.cmodified+4−0View file

drivers/input/input.c

View file
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 846ccdd..d2965e4 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1871,6 +1871,10 @@ void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int
break;
case EV_ABS:
+ input_alloc_absinfo(dev);
+ if (!dev->absinfo)
+ return;
+
__set_bit(code, dev->absbit);
break;