Prev: isdn/gigaset: improve CAPI message debugging
Next: [PATCH] acer-wmi: fix memory leaks in WMID_set_capabilities and get_wmid_devices
From: Axel Lin on 5 Jul 2010 22:40 Add error checking and return -ENOMEM if input_allocate_device() fail. Signed-off-by: Axel Lin <axel.lin(a)gmail.com> --- drivers/platform/x86/hp-wmi.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 51c07a0..c508e20 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -402,6 +402,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"; -- 1.5.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |