[PATCH v3 22/22] dyndbg: id the bad word in parse-flags err msg

From: Łukasz Bartosik
Date: Fri Dec 22 2023 - 20:57:38 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 4718e8faa719..d834581c785b 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -936,7 +936,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.472.g3155946c3a-goog