From: Axel Lin <axel.lin@xxxxxxxxx> Add error checking and return -ENOMEM if input_allocate_device() fail. Signed-off-by: Axel Lin <axel.lin@xxxxxxxxx> Acked-by: Thomas Renninger <trenn@xxxxxxx> Cc: Matthew Garrett <mjg@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/platform/x86/hp-wmi.c | 2 ++ 1 file changed, 2 insertions(+) diff -puN drivers/platform/x86/hp-wmi.c~hp-wmi-add-return-value-checking-for-input_allocate_device drivers/platform/x86/hp-wmi.c --- a/drivers/platform/x86/hp-wmi.c~hp-wmi-add-return-value-checking-for-input_allocate_device +++ a/drivers/platform/x86/hp-wmi.c @@ -527,6 +527,8 @@ static int __init hp_wmi_input_setup(voi 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"; _ -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html