summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-08-23 12:22:10 -0600
committerJens Axboe <axboe@kernel.dk>2018-08-23 12:22:10 -0600
commit49e1ade14949b737dbd111b19a4057faf9aa77bb (patch)
tree9f82e9c077237ac1effb074699a2855ceaad6b38
parent7ab5b8d29ab4402f921b9d4d9a75d34aa9c69f69 (diff)
downloadfio-49e1ade14949b737dbd111b19a4057faf9aa77bb.tar.gz
fio-49e1ade14949b737dbd111b19a4057faf9aa77bb.tar.bz2
axmap: return early of an overlap results in 0 settable bits
Reported-by: Bart Van Assche <bart.vanassche@wdc.com> Fixes: 15a4f49 ("lib/axmap: Simplify axmap_set_fn()") Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--lib/axmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/axmap.c b/lib/axmap.c
index e194e807..03e712f5 100644
--- a/lib/axmap.c
+++ b/lib/axmap.c
@@ -241,6 +241,8 @@ static bool axmap_set_fn(struct axmap_level *al, unsigned long offset,
if (overlap) {
nr_bits = ffz(~overlap) - bit;
+ if (!nr_bits)
+ return true;
mask = bit_masks[nr_bits] << bit;
}