]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/Locker.cc: fix explicit null dereferenced
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 31 May 2013 16:28:07 +0000 (18:28 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 31 May 2013 17:15:22 +0000 (19:15 +0200)
CID 716916 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
  var_deref_model: Passing null pointer "in" to function
  "CInode::is_head()", which dereferences it.

Add assert.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/mds/Locker.cc

index 57154b3d9f6d1000a26b65e3485dca863a2ab8a6..127db262b4624a4163149cc018600c217bff488e 100644 (file)
@@ -615,6 +615,7 @@ void Locker::eval_gather(SimpleLock *lock, bool first, bool *pneed_issue, list<C
   bool need_issue = false;
 
   int loner_issued = 0, other_issued = 0, xlocker_issued = 0;
+  assert(!caps || in != NULL);
   if (caps && in->is_head()) {
     in->get_caps_issued(&loner_issued, &other_issued, &xlocker_issued,
                        lock->get_cap_shift(), lock->get_cap_mask());