CID 716921 (#1 of 1): Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointer "dir" to function
"operator <<(std::ostream &, CDir &)", which dereferences it.
CID 716992 (#1 of 1): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "dir"
when calling "MDSCacheObject::is_auth() const".
Add assert for 'dir' before use it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
} else {
// which dirfrag for this dentry?
CDir *dir = diri->get_dirfrag(diri->pick_dirfrag(p->first.first));
+ assert(dir);
assert(dir->is_auth());
dn = dir->lookup(p->first.first, p->first.second);
- }
+ }
if (!dn)
dout(0) << " missing dentry for " << p->first.first << " snap " << p->first.second << " in " << *dir << dendl;