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:
parent
52db9819ac
commit
1f4bb06643
|
@ -483,7 +483,7 @@ static int gpio_keys_get_devtree_pdata(struct device *dev,
|
||||||
|
|
||||||
buttons = kzalloc(pdata->nbuttons * (sizeof *buttons), GFP_KERNEL);
|
buttons = kzalloc(pdata->nbuttons * (sizeof *buttons), GFP_KERNEL);
|
||||||
if (!buttons)
|
if (!buttons)
|
||||||
return -ENODEV;
|
return -ENOMEM;
|
||||||
|
|
||||||
pp = NULL;
|
pp = NULL;
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
Loading…
Reference in New Issue