Skip to content

Commit

Permalink
hp-wmi: add return value checking for input_allocate_device()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Matthew Garrett committed Aug 3, 2010
1 parent 1bd1ca1 commit bc28596
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/platform/x86/hp-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit bc28596

Please sign in to comment.