[PATCH 10/25] dynamic_debug: dont kill entire facility on error parsing ddebug_query

Jim Cromie
2011-07-25T21:47:58Z

Currently, a parsing error on ddebug_query results in effective loss
of the facility; all tables are removed, and the init-call returns error.
This is way too severe, especially when an innocent quoting error can
be the cause:

Kernel command line: ... ddebug_query='file char_dev.c +p'
yields:

ddebug_exec_queries: query 0: "'file"
query before parse <'file>
ddebug_exec_queries: processed 1 queries, with 1 errs
Invalid ddebug boot param 'file

Fix this by zeroing return-code for query parse errors before
returning from dynamic_debug_init().

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
lib/dynamic_debug.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index c6d38b4..1ced79e 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -888,8 +888,10 @@ static int __init dynamic_debug_init(void)
pr_info("ddebug initializing with string \"%s\"",
ddebug_setup_string);
ret = ddebug_exec_queries(ddebug_setup_string);
- if (ret)
+ if (ret) {
+ ret = 0; /* make this non-fatal */
pr_warn("invalid ddebug_query\n");
+ }
}

out_free:
--
1.7.4.1