diff options
author | Jim Cromie | 2024-04-29 13:31:11 -0600 |
---|---|---|
committer | Greg Kroah-Hartman | 2024-04-30 09:20:48 +0200 |
commit | 00e7d3bea2ce7dac7bee1cf501fb071fd0ea8f6c (patch) | |
tree | 59c0d92733a8cb7d1ae5513bbf9ae7048b812ac0 /lib | |
parent | 9b83aa7a50095848066ee8dcb894e48cf9efae7c (diff) |
dyndbg: fix old BUG_ON in >control parser
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')
-rw-r--r-- | lib/dynamic_debug.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index c78f335fa981..f2c5e7910bb1 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 */ |