From: Irwan Djajadi Date: Fri, 20 Jan 2006 20:28:00 +0000 (-0500) Subject: [ACPI] drivers/acpi/hotkey.c: check kmalloc return value X-Git-Tag: firefly_0821_release~35458^2~19^2~13^2~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1fee94034917aa711fcbd4ebf4c36f7ebd9fa7d6;p=firefly-linux-kernel-4.4.55.git [ACPI] drivers/acpi/hotkey.c: check kmalloc return value Signed-off-by: Irwan Djajadi Signed-off-by: Alexey Dobriyan Signed-off-by: Len Brown --- diff --git a/drivers/acpi/hotkey.c b/drivers/acpi/hotkey.c index 2e2e4051dfa7..c25b2b92edcf 100644 --- a/drivers/acpi/hotkey.c +++ b/drivers/acpi/hotkey.c @@ -723,6 +723,8 @@ get_parms(char *config_record, goto do_fail; count = tmp1 - tmp; *action_handle = (char *)kmalloc(count + 1, GFP_KERNEL); + if (!*action_handle) + goto do_fail; strncpy(*action_handle, tmp, count); *(*action_handle + count) = 0;