From: Pramod Gurav Date: Sat, 26 Jul 2014 01:41:39 +0000 (-0700) Subject: Input: soc_button_array - add missing memory allocation check X-Git-Tag: v5.15~74^2~978 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91cf07cdaedbc29d03f572a1b0e5cf41ee6febab;p=platform%2Fkernel%2Flinux-starfive.git Input: soc_button_array - add missing memory allocation check Signed-off-by: Pramod Gurav Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c index 5a6334b..e34dfc2 100644 --- a/drivers/input/misc/soc_button_array.c +++ b/drivers/input/misc/soc_button_array.c @@ -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++) {