Skip to content

Commit

Permalink
Input: gpio_keys - return proper error code if memory allocation fails
Browse files Browse the repository at this point in the history
Return -ENOMEM if kzalloc fails in gpio_keys_get_devtree_pdata().

Signed-off-by: Tobias Klauser <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
tklauser authored and dtor committed Jul 30, 2011
1 parent 52db981 commit 1f4bb06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/keyboard/gpio_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1f4bb06

Please sign in to comment.