summaryrefslogtreecommitdiff
path: root/lib/dynamic_debug.c
diff options
context:
space:
mode:
authorJim Cromie <jim.cromie@gmail.com>2024-04-29 13:31:11 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-05-17 12:02:33 +0200
commita69e1bdd777ce51061111dc419801e8a2fd241cc (patch)
treedd750012c8050f3e36f812bcefbbfcfc3261c330 /lib/dynamic_debug.c
parentca3cb178678b4aa8309a740b0fd613f367f7a9c7 (diff)
downloadlinux-a69e1bdd777ce51061111dc419801e8a2fd241cc.tar.gz
linux-a69e1bdd777ce51061111dc419801e8a2fd241cc.tar.bz2
linux-a69e1bdd777ce51061111dc419801e8a2fd241cc.zip
dyndbg: fix old BUG_ON in >control parser
commit 00e7d3bea2ce7dac7bee1cf501fb071fd0ea8f6c upstream. Fix a BUG_ON from 2009. Even if it looks "unreachable" (I didn't really look), lets make sure by removing it, doing pr_err and return -EINVAL instead. Cc: stable <stable@kernel.org> Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Link: https://lore.kernel.org/r/20240429193145.66543-2-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/dynamic_debug.c')
-rw-r--r--lib/dynamic_debug.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 6fba6423cc10..a5a687e1c919 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -302,7 +302,11 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords)
} else {
for (end = buf; *end && !isspace(*end); end++)
;
- BUG_ON(end == buf);
+ if (end == buf) {
+ pr_err("parse err after word:%d=%s\n", nwords,
+ nwords ? words[nwords - 1] : "<none>");
+ return -EINVAL;
+ }
}
/* `buf' is start of word, `end' is one past its end */