[ACPI] drivers/acpi/hotkey.c: check kmalloc return value
Signed-off-by: Irwan Djajadi <irwan.djajadi@iname.com> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
parent
ce362c0092
commit
1fee940349
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue