diff options
author | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-05-31 18:42:20 +0200 |
---|---|---|
committer | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-05-31 19:15:22 +0200 |
commit | 3969c695d947eb4a41928710503c82beaaf58e43 (patch) | |
tree | d7be1bf8a515af13118a1ebe7becfea665102412 | |
parent | bb8798e320dc892a8bedf9d9c58393fe13c21ad2 (diff) | |
download | ceph-3969c695d947eb4a41928710503c82beaaf58e43.tar.gz |
mds/Locker.cc: fix dereference after null check
CID 716918 (#1 of 1): Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointer "in" to function
"MDSCacheObject::state_test(unsigned int) const", which
dereferences it.
Add assert for 'in == NULL' before use it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
-rw-r--r-- | src/mds/Locker.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 5cf8ac8ad3d..41421f3e2a6 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -3464,11 +3464,13 @@ bool Locker::simple_sync(SimpleLock *lock, bool *need_issue) } } - if (lock->get_type() == CEPH_LOCK_IFILE && - in->state_test(CInode::STATE_NEEDSRECOVER)) { - mds->mdcache->queue_file_recover(in); - mds->mdcache->do_file_recover(); - gather++; + if (lock->get_type() == CEPH_LOCK_IFILE) { + assert(in); + if (in->state_test(CInode::STATE_NEEDSRECOVER)) { + mds->mdcache->queue_file_recover(in); + mds->mdcache->do_file_recover(); + gather++; + } } if (!gather && lock->is_dirty()) { |