]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
BlueStore: fix potential null pointer access
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 6 Jan 2016 08:47:36 +0000 (16:47 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 14 Jan 2016 06:30:03 +0000 (14:30 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index f7a04319cbb92d25283787727fc26306240abc74..ea9a3e40316ca448b489cc2daac08293e2ec3d28 100644 (file)
@@ -5530,7 +5530,7 @@ int BlueStore::_truncate(TransContext *txc,
 
   RWLock::WLocker l(c->lock);
   OnodeRef o = c->get_onode(oid, false);
-  if (!o->exists) {
+  if (!o || !o->exists) {
     r = -ENOENT;
     goto out;
   }