mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 14:42:24 +00:00
Input: soc_button_array - add missing memory allocation check
Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
5e740ce604
commit
91cf07cdae
@ -83,6 +83,9 @@ soc_button_device_create(struct pnp_dev *pdev,
|
||||
sizeof(*gpio_keys_pdata) +
|
||||
sizeof(*gpio_keys) * MAX_NBUTTONS,
|
||||
GFP_KERNEL);
|
||||
if (!gpio_keys_pdata)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
gpio_keys = (void *)(gpio_keys_pdata + 1);
|
||||
|
||||
for (info = button_info; info->name; info++) {
|
||||
|
Loading…
Reference in New Issue
Block a user