From: Dmitry Torokhov Date: Fri, 27 Dec 2013 01:44:29 +0000 (-0800) Subject: Input: allocate absinfo data when setting ABS capability X-Git-Tag: firefly_0821_release~3679^2~3176 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2d8ccbd72d8e44d40daa7500a5a78cc8ccad02f1;p=firefly-linux-kernel-4.4.55.git Input: allocate absinfo data when setting ABS capability commit 28a2a2e1aedbe2d8b2301e6e0e4e63f6e4177aca upstream. 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 Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/input/input.c b/drivers/input/input.c index c04469928925..66984e272c45 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1866,6 +1866,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;