[PATCH v4 23/39] dyndbg: display the bad flag-val in parse-flags err msg

From: Łukasz Bartosik
Date: Sat Feb 10 2024 - 18:56:11 EST


From: Jim Cromie <jim.cromie@xxxxxxxxx>

If ddebug_parse_flags() rejects user input, identify that input value
in the error message.

Signed-off-by: Jim Cromie <jim.cromie@xxxxxxxxx>
---
lib/dynamic_debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 4954d3e5be5b..089765afc972 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -973,7 +973,7 @@ static int ddebug_exec_query(char *query_string, const char *modname)

/* check flags 1st (last arg) so query is pairs of spec,val */
if (ddebug_parse_flags(words[nwords-1], &modifiers)) {
- pr_err("flags parse failed\n");
+ pr_err("flags parse failed on word-%d: %s\n", nwords-1, words[nwords-1]);
goto err;
}

--
2.43.0.687.g38aa6559b0-goog