Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc28596a authored by Axel Lin's avatar Axel Lin Committed by Matthew Garrett
Browse files

hp-wmi: add return value checking for input_allocate_device()



Add error checking and return -ENOMEM if input_allocate_device() fail.

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarThomas Renninger <trenn@suse.de>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent 1bd1ca1f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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";