Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Pramod Gurav and committed by
Dmitry Torokhov
91cf07cd 5e740ce6

+3
+3
drivers/input/misc/soc_button_array.c
··· 83 83 sizeof(*gpio_keys_pdata) + 84 84 sizeof(*gpio_keys) * MAX_NBUTTONS, 85 85 GFP_KERNEL); 86 + if (!gpio_keys_pdata) 87 + return ERR_PTR(-ENOMEM); 88 + 86 89 gpio_keys = (void *)(gpio_keys_pdata + 1); 87 90 88 91 for (info = button_info; info->name; info++) {