mirror of
https://github.com/torvalds/linux.git
synced 2024-12-02 00:51:44 +00:00
drbd: Fix test of unsigned in _drbd_fault_random()
rsp->count is unsigned so the test does not work. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
This commit is contained in:
parent
7d4e9d0962
commit
49829ea74f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user