diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2016-01-15 19:58:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-16 14:17:27 -0500 |
commit | fd0515d50ff33865d0f8cdd74510e8bd1aee88ac (patch) | |
tree | 29ffd279073c8cfaf3e40e7ae2935256e3812cdc | |
parent | 8e2a2bfdb86ecb2421e3dd18d0fbbb42f2d943ad (diff) |
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 <linux@rasmusvillemoes.dk>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Joe Perches <joe@perches.com>
Cc: Maurizio Lombardi <mlombard@redhat.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-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, ...) | |||
91 | int rand; | 91 | int rand; |
92 | char *p; | 92 | char *p; |
93 | 93 | ||
94 | BUG_ON(elen >= BUF_SIZE); | 94 | if (elen >= BUF_SIZE) { |
95 | pr_err("error in test suite: expected output length %d too long. Format was '%s'.\n", | ||
96 | elen, fmt); | ||
97 | failed_tests++; | ||
98 | return; | ||
99 | } | ||
95 | 100 | ||
96 | va_start(ap, fmt); | 101 | va_start(ap, fmt); |
97 | 102 | ||