Commit bc28596a authored by Axel Lin's avatar Axel Lin Committed by Matthew Garrett

hp-wmi: add return value checking for input_allocate_device()

Add error checking and return -ENOMEM if input_allocate_device() fail.
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarThomas Renninger <trenn@suse.de>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent 1bd1ca1f
...@@ -527,6 +527,8 @@ static int __init hp_wmi_input_setup(void) ...@@ -527,6 +527,8 @@ static int __init hp_wmi_input_setup(void)
int err; int err;
hp_wmi_input_dev = input_allocate_device(); 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->name = "HP WMI hotkeys";
hp_wmi_input_dev->phys = "wmi/input0"; hp_wmi_input_dev->phys = "wmi/input0";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment