From: Roel Kluin Date: Tue, 15 Dec 2009 21:55:44 +0000 (+0100) Subject: drbd: Fix test of unsigned in _drbd_fault_random() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=49829ea74f790d3be2e803a617e714f5b9a5ed50;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git drbd: Fix test of unsigned in _drbd_fault_random() rsp->count is unsigned so the test does not work. Signed-off-by: Roel Kluin Signed-off-by: Andrew Morton Signed-off-by: Philipp Reisner --- diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index af30ca97493c..ecc1612df676 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -3623,7 +3623,7 @@ _drbd_fault_random(struct fault_random_state *rsp) { long refresh; - if (--rsp->count < 0) { + if (!rsp->count--) { get_random_bytes(&refresh, sizeof(refresh)); rsp->state += refresh; rsp->count = FAULT_RANDOM_REFRESH;