diff options
author | Jim Cromie <jim.cromie@gmail.com> | 2024-04-29 22:31:11 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-05-17 12:56:20 +0300 |
commit | a66c869b17c4c4dcf81d273b02cb0efe88e127ab (patch) | |
tree | 74fbabbafe5d089cf02ec6697f89c855245fbd3e | |
parent | 0b47bbc91f1a2a7a4c4c9ff71e81e3bd24fa54a1 (diff) | |
download | linux-a66c869b17c4c4dcf81d273b02cb0efe88e127ab.tar.xz |
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>
-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 009f2ead09c1..939678ea930e 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -301,7 +301,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 */ |