diff mbox

[21/26] hp-wmi: add return value checking for input_allocate_device()

Message ID 201007202219.o6KMJplm021085@imap1.linux-foundation.org (mailing list archive)
State New, archived
Headers show

Commit Message

Andrew Morton July 20, 2010, 10:19 p.m. UTC
None
diff mbox

Patch

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