Skip to content

Commit 1f4bb06

Browse files
tklauserdtor
authored andcommitted
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>
1 parent 52db981 commit 1f4bb06

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/input/keyboard/gpio_keys.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ static int gpio_keys_get_devtree_pdata(struct device *dev,
483483

484484
buttons = kzalloc(pdata->nbuttons * (sizeof *buttons), GFP_KERNEL);
485485
if (!buttons)
486-
return -ENODEV;
486+
return -ENOMEM;
487487

488488
pp = NULL;
489489
i = 0;

0 commit comments

Comments
 (0)