]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: dentry always has dir
authorSage Weil <sage@inktank.com>
Sat, 29 Sep 2012 00:56:34 +0000 (17:56 -0700)
committerSage Weil <sage@inktank.com>
Sat, 29 Sep 2012 00:56:34 +0000 (17:56 -0700)
CID 716912: Dereference after null check (FORWARD_NULL)
At (3): Passing null pointer "this->dir" to function "CDir::ino() const", which dereferences it. [hide details]

Signed-off-by: Sage Weil <sage@inktank.com>
src/mds/CDentry.cc

index ee58436123a122ec48aebb8c98e21cb6421ec237..7dd88ac10a79ad3ce7835398a1d2f2d92a1a1457 100644 (file)
@@ -260,8 +260,7 @@ void CDentry::make_path(string& s, inodeno_t tobase)
 void CDentry::make_anchor_trace(vector<Anchor>& trace, CInode *in)
 {
   // start with parent dir inode
-  if (dir)
-    dir->inode->make_anchor_trace(trace);
+  dir->inode->make_anchor_trace(trace);
 
   // add this inode (in my dirfrag) to the end
   trace.push_back(Anchor(in->ino(), dir->ino(), get_hash(), 0, 0));