diff options
-rw-r--r-- | block/badblocks.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/badblocks.c b/block/badblocks.c index 88f27d4f3856..43430bd3efa7 100644 --- a/block/badblocks.c +++ b/block/badblocks.c @@ -700,7 +700,7 @@ static bool can_front_overwrite(struct badblocks *bb, int prev, *extra = 2; } - if ((bb->count + (*extra)) >= MAX_BADBLOCKS) + if ((bb->count + (*extra)) > MAX_BADBLOCKS) return false; return true; @@ -1135,7 +1135,7 @@ re_clear: if ((BB_OFFSET(p[prev]) < bad.start) && (BB_END(p[prev]) > (bad.start + bad.len))) { /* Splitting */ - if ((bb->count + 1) < MAX_BADBLOCKS) { + if ((bb->count + 1) <= MAX_BADBLOCKS) { len = front_splitting_clear(bb, prev, &bad); bb->count += 1; cleared++; |