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>
This commit is contained in:
Tobias Klauser 2011-07-30 12:08:10 -07:00 committed by Dmitry Torokhov
parent 52db9819ac
commit 1f4bb06643
1 changed files with 1 additions and 1 deletions

View 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;