diff options
| author | Rasmus Villemoes <[email protected]> | 2016-01-16 00:58:50 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2016-01-16 19:17:27 +0000 |
| commit | fd0515d50ff33865d0f8cdd74510e8bd1aee88ac (patch) | |
| tree | 29ffd279073c8cfaf3e40e7ae2935256e3812cdc /lib/test_printf.c | |
| parent | lib/kasprintf.c: add sanity check to kvasprintf (diff) | |
| download | kernel-fd0515d50ff33865d0f8cdd74510e8bd1aee88ac.tar.gz kernel-fd0515d50ff33865d0f8cdd74510e8bd1aee88ac.zip | |
lib/test_printf.c: don't BUG
BUG is a completely unnecessarily big hammer, and we're more likely to
get the internal bug reported if we just pr_err() and ensure the test
suite fails.
Signed-off-by: Rasmus Villemoes <[email protected]>
Acked-by: Kees Cook <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Maurizio Lombardi <[email protected]>
Cc: Tejun Heo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/test_printf.c')
| -rw-r--r-- | lib/test_printf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/test_printf.c b/lib/test_printf.c index c5a666af9ba5..9232a2add28c 100644 --- a/lib/test_printf.c +++ b/lib/test_printf.c @@ -91,7 +91,12 @@ __test(const char *expect, int elen, const char *fmt, ...) int rand; char *p; - BUG_ON(elen >= BUF_SIZE); + if (elen >= BUF_SIZE) { + pr_err("error in test suite: expected output length %d too long. Format was '%s'.\n", + elen, fmt); + failed_tests++; + return; + } va_start(ap, fmt); |
