Fix following warning from cppcheck:
[src/mds/Locker.cc:2255] -> [src/mds/Locker.cc:2258]: (error)
Possible null pointer dereference: in - otherwise it is redundant
to check it against null.
Since head_in used for call pick_inode_snap() is already valid,
there is no need to check if 'CInode *in' is not NULL. Remove
not needed check.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
return;
}
- CInode *in = 0;
- in = mdcache->pick_inode_snap(head_in, follows);
+ CInode *in = mdcache->pick_inode_snap(head_in, follows);
if (in != head_in)
dout(10) << " head inode " << *head_in << dendl;
dout(10) << " cap inode " << *in << dendl;
Capability *cap = 0;
- if (in)
- cap = in->get_client_cap(client);
+ cap = in->get_client_cap(client);
if (!cap && in != head_in)
cap = head_in->get_client_cap(client);
if (!cap) {