summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2013-12-26 17:44:29 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-09 12:24:24 -0800
commit2d8ccbd72d8e44d40daa7500a5a78cc8ccad02f1 (patch)
tree493244f3a14ddd40f725b742fed45d11b39f332c /drivers/input
parentc074c8f4a7135a4175a73a8b87564c68b71746fe (diff)
downloadlinux-stable-2d8ccbd72d8e44d40daa7500a5a78cc8ccad02f1.tar.gz
linux-stable-2d8ccbd72d8e44d40daa7500a5a78cc8ccad02f1.tar.bz2
linux-stable-2d8ccbd72d8e44d40daa7500a5a78cc8ccad02f1.zip
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 <pcercuei@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/input.c4
1 files changed, 4 insertions, 0 deletions
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;