diff options
author | Anton Blanchard <anton@samba.org> | 2012-06-20 21:53:03 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-20 23:39:36 +0200 |
commit | f39cdaebb89dc3e6dd4f3e75b6d4e87ef12190af (patch) | |
tree | 3e6db2d5c97c822591350be26a09097589ef5b8c /kernel/exit.c | |
parent | Viresh has moved (diff) | |
download | linux-f39cdaebb89dc3e6dd4f3e75b6d4e87ef12190af.tar.xz linux-f39cdaebb89dc3e6dd4f3e75b6d4e87ef12190af.zip |
fault-inject: avoid call to random32() if fault injection is disabled
After enabling CONFIG_FAILSLAB I noticed random32 in profiles even if slub
fault injection wasn't enabled at runtime.
should_fail forces a comparison against random32() even if probability is
0:
if (attr->probability <= random32() % 100)
return false;
Add a check up front for probability == 0 and avoid all of the more
complicated checks.
Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/exit.c')
0 files changed, 0 insertions, 0 deletions