Skip to content
Commit 33d6e0ff authored by Peter Rosin's avatar Peter Rosin Committed by Linus Torvalds
Browse files

lib/test_string.c: avoid masking memset16/32/64 failures

If a memsetXX implementation is completely broken and fails in the first
iteration, when i, j, and k are all zero, the failure is masked as zero
is returned.  Failing in the first iteration is perhaps the most likely
failure, so this makes the tests pretty much useless.  Avoid the
situation by always setting a random unused bit in the result on
failure.

Link: http://lkml.kernel.org/r/20190506124634.6807-3-peda@axentia.se


Fixes: 03270c13 ("lib/string.c: add testcases for memset16/32/64")
Signed-off-by: default avatarPeter Rosin <peda@axentia.se>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b0975710
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment