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>
This commit is contained in:
Axel Lin 2010-07-20 15:19:51 -07:00 committed by Matthew Garrett
parent 1bd1ca1f4c
commit bc28596a8f
1 changed files with 2 additions and 0 deletions

View File

@ -527,6 +527,8 @@ static int __init hp_wmi_input_setup(void)
int err;
hp_wmi_input_dev = input_allocate_device();
if (!hp_wmi_input_dev)
return -ENOMEM;
hp_wmi_input_dev->name = "HP WMI hotkeys";
hp_wmi_input_dev->phys = "wmi/input0";