From 1f4bb066433322f6f189b084ceebdfb4add77292 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sat, 30 Jul 2011 12:08:10 -0700 Subject: Input: gpio_keys - return proper error code if memory allocation fails Return -ENOMEM if kzalloc fails in gpio_keys_get_devtree_pdata(). Signed-off-by: Tobias Klauser Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/gpio_keys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/input') diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index ce281d152275..67df91af8424 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -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; -- cgit v1.2.3-58-ga151