Browse Source

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 <tklauser@distanz.ch>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Tobias Klauser 14 years ago
parent
commit
1f4bb06643
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/input/keyboard/gpio_keys.c

+ 1 - 1
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;