Skip to content

Commit 00e7d3b

Browse files
jimcgregkh
authored andcommitted
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>
1 parent 9b83aa7 commit 00e7d3b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/dynamic_debug.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,11 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords)
302302
} else {
303303
for (end = buf; *end && !isspace(*end); end++)
304304
;
305-
BUG_ON(end == buf);
305+
if (end == buf) {
306+
pr_err("parse err after word:%d=%s\n", nwords,
307+
nwords ? words[nwords - 1] : "<none>");
308+
return -EINVAL;
309+
}
306310
}
307311

308312
/* `buf' is start of word, `end' is one past its end */

0 commit comments

Comments
 (0)