From: xie xingguo Date: Sat, 24 Dec 2016 08:48:24 +0000 (+0800) Subject: os/bluestore/BitAllocator: fix potential null pointer access X-Git-Tag: v12.0.0~182^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=267eb9576fc39e0d20d7491b5a2c55be9c7f7722;p=ceph.git os/bluestore/BitAllocator: fix potential null pointer access Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BitAllocator.cc b/src/os/bluestore/BitAllocator.cc index 1b48fa0abf0..105e622c6d1 100644 --- a/src/os/bluestore/BitAllocator.cc +++ b/src/os/bluestore/BitAllocator.cc @@ -581,6 +581,9 @@ int64_t BitMapZone::alloc_blocks_dis(int64_t num_blocks, BitMapEntityIter iter = BitMapEntityIter( m_bmap_list, bmap_idx); bmap = iter.next(); + if (!bmap) { + return 0; + } while (allocated < num_blocks) { blk_off = zone_blk_off + bmap_idx * bmap->size();