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>
        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";