From bc28596a8fe5034ef776b0be2e0bf5629a31f746 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 20 Jul 2010 15:19:51 -0700 Subject: 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 Acked-by: Thomas Renninger Cc: Matthew Garrett Signed-off-by: Andrew Morton Signed-off-by: Matthew Garrett diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 34b4178..c5f95d1 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -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"; -- cgit v0.10.2