Avoid useless have_inode() call.
CID 716996: Dereference null return value (NULL_RETURNS)
At (13): Dereferencing a pointer that might be null "this->get_inode(df.ino, snapid_t(18446744073709551614UL))" when calling "CInode::get_dirfrag(frag_t)". [hide details]
Signed-off-by: Sage Weil <sage@inktank.com>
}
CDir* get_dirfrag(dirfrag_t df) {
- if (!have_inode(df.ino)) return NULL;
- return get_inode(df.ino)->get_dirfrag(df.frag);
+ CInode *in = get_inode(df.ino);
+ if (!in)
+ return NULL;
+ return in->get_dirfrag(df.frag);
}
CDir* get_force_dirfrag(dirfrag_t df) {
CInode *diri = get_inode(df.ino);