diff options
author | Axel Lin <axel.lin@gmail.com> | 2010-07-20 18:19:51 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2010-08-03 09:49:02 -0400 |
commit | bc28596a8fe5034ef776b0be2e0bf5629a31f746 (patch) | |
tree | cfc5b39c733cdfe111c60c906b3948887905723c /drivers/platform | |
parent | 1bd1ca1f4ce99c5be041bfc2997e394cdb5240dc (diff) |
hp-wmi: add return value checking for input_allocate_device()
Add error checking and return -ENOMEM if input_allocate_device() fail.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Thomas Renninger <trenn@suse.de>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/hp-wmi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 34b417848e29..c5f95d1e0315 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c | |||
@@ -527,6 +527,8 @@ static int __init hp_wmi_input_setup(void) | |||
527 | int err; | 527 | int err; |
528 | 528 | ||
529 | hp_wmi_input_dev = input_allocate_device(); | 529 | hp_wmi_input_dev = input_allocate_device(); |
530 | if (!hp_wmi_input_dev) | ||
531 | return -ENOMEM; | ||
530 | 532 | ||
531 | hp_wmi_input_dev->name = "HP WMI hotkeys"; | 533 | hp_wmi_input_dev->name = "HP WMI hotkeys"; |
532 | hp_wmi_input_dev->phys = "wmi/input0"; | 534 | hp_wmi_input_dev->phys = "wmi/input0"; |