diff options
author | Pramod Gurav <pramod.gurav@smartplayin.com> | 2014-07-25 21:41:39 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-07-25 21:58:41 -0400 |
commit | 91cf07cdaedbc29d03f572a1b0e5cf41ee6febab (patch) | |
tree | a98b21d2d28687fc9cc7bcee593063646eeb5133 /drivers/input/misc/soc_button_array.c | |
parent | 5e740ce6043da476f1ee61c18af7d1df40ecbb57 (diff) |
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>
Diffstat (limited to 'drivers/input/misc/soc_button_array.c')
-rw-r--r-- | drivers/input/misc/soc_button_array.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c index 5a6334be30b8..e34dfc29beb3 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, | |||
83 | sizeof(*gpio_keys_pdata) + | 83 | sizeof(*gpio_keys_pdata) + |
84 | sizeof(*gpio_keys) * MAX_NBUTTONS, | 84 | sizeof(*gpio_keys) * MAX_NBUTTONS, |
85 | GFP_KERNEL); | 85 | GFP_KERNEL); |
86 | if (!gpio_keys_pdata) | ||
87 | return ERR_PTR(-ENOMEM); | ||
88 | |||
86 | gpio_keys = (void *)(gpio_keys_pdata + 1); | 89 | gpio_keys = (void *)(gpio_keys_pdata + 1); |
87 | 90 | ||
88 | for (info = button_info; info->name; info++) { | 91 | for (info = button_info; info->name; info++) { |