diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-14 23:50:58 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-14 23:50:58 +0200 |
commit | feea468014f0c2f930b149e83a9047da86b26e4e (patch) | |
tree | 29807205f471d63affd20e1e36fc3f832b55a106 /lib/fault-inject.c | |
parent | MAINTAINERS: add entry for mediatek usb3 DRD IP driver (diff) | |
parent | Linux 4.13-rc5 (diff) | |
download | linux-feea468014f0c2f930b149e83a9047da86b26e4e.tar.xz linux-feea468014f0c2f930b149e83a9047da86b26e4e.zip |
Merge 4.13-rc5 into usb-next
This gets the USB fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/fault-inject.c')
-rw-r--r-- | lib/fault-inject.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/fault-inject.c b/lib/fault-inject.c index 7d315fdb9f13..cf7b129b0b2b 100644 --- a/lib/fault-inject.c +++ b/lib/fault-inject.c @@ -110,10 +110,12 @@ bool should_fail(struct fault_attr *attr, ssize_t size) if (in_task()) { unsigned int fail_nth = READ_ONCE(current->fail_nth); - if (fail_nth && !WRITE_ONCE(current->fail_nth, fail_nth - 1)) - goto fail; + if (fail_nth) { + if (!WRITE_ONCE(current->fail_nth, fail_nth - 1)) + goto fail; - return false; + return false; + } } /* No need to check any other properties if the probability is 0 */ |