aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/dynamic_debug.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 3b06f926d5b8..66e0ec4d21f7 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -984,7 +984,7 @@ static int __init dynamic_debug_init(void)
984 if (strcmp(modname, iter->modname)) { 984 if (strcmp(modname, iter->modname)) {
985 ret = ddebug_add_module(iter_start, n, modname); 985 ret = ddebug_add_module(iter_start, n, modname);
986 if (ret) 986 if (ret)
987 goto out_free; 987 goto out_err;
988 n = 0; 988 n = 0;
989 modname = iter->modname; 989 modname = iter->modname;
990 iter_start = iter; 990 iter_start = iter;
@@ -993,9 +993,11 @@ static int __init dynamic_debug_init(void)
993 } 993 }
994 ret = ddebug_add_module(iter_start, n, modname); 994 ret = ddebug_add_module(iter_start, n, modname);
995 if (ret) 995 if (ret)
996 goto out_free; 996 goto out_err;
997 997
998 /* ddebug_query boot param got passed -> set it up */ 998 ddebug_init_success = 1;
999
1000 /* apply ddebug_query boot param, dont unload tables on err */
999 if (ddebug_setup_string[0] != '\0') { 1001 if (ddebug_setup_string[0] != '\0') {
1000 pr_warn("ddebug_query param name is deprecated," 1002 pr_warn("ddebug_query param name is deprecated,"
1001 " change it to dyndbg\n"); 1003 " change it to dyndbg\n");
@@ -1005,9 +1007,6 @@ static int __init dynamic_debug_init(void)
1005 ddebug_setup_string); 1007 ddebug_setup_string);
1006 else 1008 else
1007 pr_info("%d changes by ddebug_query\n", ret); 1009 pr_info("%d changes by ddebug_query\n", ret);
1008
1009 /* keep tables even on ddebug_query parse error */
1010 ret = 0;
1011 } 1010 }
1012 /* now that ddebug tables are loaded, process all boot args 1011 /* now that ddebug tables are loaded, process all boot args
1013 * again to find and activate queries given in dyndbg params. 1012 * again to find and activate queries given in dyndbg params.
@@ -1021,12 +1020,10 @@ static int __init dynamic_debug_init(void)
1021 parse_args("dyndbg params", cmdline, NULL, 1020 parse_args("dyndbg params", cmdline, NULL,
1022 0, 0, 0, &ddebug_dyndbg_boot_param_cb); 1021 0, 0, 0, &ddebug_dyndbg_boot_param_cb);
1023 kfree(cmdline); 1022 kfree(cmdline);
1023 return 0;
1024 1024
1025out_free: 1025out_err:
1026 if (ret) 1026 ddebug_remove_all_tables();
1027 ddebug_remove_all_tables();
1028 else
1029 ddebug_init_success = 1;
1030 return 0; 1027 return 0;
1031} 1028}
1032/* Allow early initialization for boot messages via boot param */ 1029/* Allow early initialization for boot messages via boot param */