hp-wmi: add return value checking for input_allocate_device()
Subsystems (2)
PATCH 21/26 hp-wmi: add return value checking for input_allocate_device()
From: Axel Lin <[email protected]>
Add error checking and return -ENOMEM if input_allocate_device() fail.
Signed-off-by Axel Lin <[email protected]>
Acked-by Thomas Renninger <[email protected]>
Cc Matthew Garrett <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/platform/x86/hp-wmi.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/platform/x86/hp-wmi.c renamed from drivers/platform/x86/hp-wmi.c~hp-wmi-add-return-value-checking-for-input_allocate_device +2 -0
@@ -527,6 +527,8 @@ static int __init hp_wmi_input_setup(voiint 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" ;
_