dynamic_debug: simplify dynamic_debug_init error exit
We dont want errors while parsing ddebug_query to unload ddebug tables, so set success after tables are loaded, and return 0 after query parsing is done. Simplify error handling code since its no longer used for success, and change goto label to out_err to clarify this. Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Acked-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6ab676e964
commit
af442399fc
@ -984,7 +984,7 @@ static int __init dynamic_debug_init(void)
|
|||||||
if (strcmp(modname, iter->modname)) {
|
if (strcmp(modname, iter->modname)) {
|
||||||
ret = ddebug_add_module(iter_start, n, modname);
|
ret = ddebug_add_module(iter_start, n, modname);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_free;
|
goto out_err;
|
||||||
n = 0;
|
n = 0;
|
||||||
modname = iter->modname;
|
modname = iter->modname;
|
||||||
iter_start = iter;
|
iter_start = iter;
|
||||||
@ -993,9 +993,11 @@ static int __init dynamic_debug_init(void)
|
|||||||
}
|
}
|
||||||
ret = ddebug_add_module(iter_start, n, modname);
|
ret = ddebug_add_module(iter_start, n, modname);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_free;
|
goto out_err;
|
||||||
|
|
||||||
/* ddebug_query boot param got passed -> set it up */
|
ddebug_init_success = 1;
|
||||||
|
|
||||||
|
/* apply ddebug_query boot param, dont unload tables on err */
|
||||||
if (ddebug_setup_string[0] != '\0') {
|
if (ddebug_setup_string[0] != '\0') {
|
||||||
pr_warn("ddebug_query param name is deprecated,"
|
pr_warn("ddebug_query param name is deprecated,"
|
||||||
" change it to dyndbg\n");
|
" change it to dyndbg\n");
|
||||||
@ -1005,9 +1007,6 @@ static int __init dynamic_debug_init(void)
|
|||||||
ddebug_setup_string);
|
ddebug_setup_string);
|
||||||
else
|
else
|
||||||
pr_info("%d changes by ddebug_query\n", ret);
|
pr_info("%d changes by ddebug_query\n", ret);
|
||||||
|
|
||||||
/* keep tables even on ddebug_query parse error */
|
|
||||||
ret = 0;
|
|
||||||
}
|
}
|
||||||
/* now that ddebug tables are loaded, process all boot args
|
/* now that ddebug tables are loaded, process all boot args
|
||||||
* again to find and activate queries given in dyndbg params.
|
* again to find and activate queries given in dyndbg params.
|
||||||
@ -1021,12 +1020,10 @@ static int __init dynamic_debug_init(void)
|
|||||||
parse_args("dyndbg params", cmdline, NULL,
|
parse_args("dyndbg params", cmdline, NULL,
|
||||||
0, 0, 0, &ddebug_dyndbg_boot_param_cb);
|
0, 0, 0, &ddebug_dyndbg_boot_param_cb);
|
||||||
kfree(cmdline);
|
kfree(cmdline);
|
||||||
|
return 0;
|
||||||
|
|
||||||
out_free:
|
out_err:
|
||||||
if (ret)
|
|
||||||
ddebug_remove_all_tables();
|
ddebug_remove_all_tables();
|
||||||
else
|
|
||||||
ddebug_init_success = 1;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* Allow early initialization for boot messages via boot param */
|
/* Allow early initialization for boot messages via boot param */
|
||||||
|
Loading…
Reference in New Issue
Block a user