dynamic_debug: Handle kstrdup failure in dynamic_debug_init

Properly handle kstrdup returning NULL in dynamic_debug_init.

Change-Id: I93039e497d7f4982c888eac2252df4fc8332a6be
Signed-off-by: David Ng <dave@codeaurora.org>
This commit is contained in:
David Ng 2015-06-17 13:19:05 -07:00 committed by Gerrit - the friendly Code Review server
parent baf62f3802
commit 0b5f2ca0a6
1 changed files with 7 additions and 3 deletions

View File

@ -1045,9 +1045,13 @@ static int __init dynamic_debug_init(void)
* slightly noisy if verbose, but harmless.
*/
cmdline = kstrdup(saved_command_line, GFP_KERNEL);
parse_args("dyndbg params", cmdline, NULL,
0, 0, 0, &ddebug_dyndbg_boot_param_cb);
kfree(cmdline);
if (cmdline) {
parse_args("dyndbg params", cmdline, NULL,
0, 0, 0, &ddebug_dyndbg_boot_param_cb);
kfree(cmdline);
} else
pr_err("Failed to parse boot args for dyndbg params\n");
return 0;
out_err: