Input: gpio_keys - return proper error code if memory allocation fails
authorTobias Klauser <tklauser@distanz.ch>
Sat, 30 Jul 2011 19:08:10 +0000 (12:08 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 30 Jul 2011 19:19:02 +0000 (12:19 -0700)
Return -ENOMEM if kzalloc fails in gpio_keys_get_devtree_pdata().

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/keyboard/gpio_keys.c

index ce281d152275783a8c27893d177b41fb9654a2a2..67df91af84244c40185ecb27c4bbdd2ae29f615b 100644 (file)
@@ -483,7 +483,7 @@ static int gpio_keys_get_devtree_pdata(struct device *dev,
 
        buttons = kzalloc(pdata->nbuttons * (sizeof *buttons), GFP_KERNEL);
        if (!buttons)
-               return -ENODEV;
+               return -ENOMEM;
 
        pp = NULL;
        i = 0;