Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c718bdd authored by Jim Cromie's avatar Jim Cromie Committed by Greg Kroah-Hartman
Browse files

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: default avatarJim Cromie <jim.cromie@gmail.com>
Link: https://lore.kernel.org/r/20240429193145.66543-2-jim.cromie@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e19ec8ab
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -242,7 +242,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 */