Assert if straydn is NULL.
CID
1019554 (#2 of 2): Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointer "straydn" to function
"MDSCacheObject::is_auth() const", which dereferences it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
// guarantee stray dir is processed first during journal replay. unlink the old inode,
// then link the source inode to destdn
- if (destdnl->is_primary() && straydn->is_auth()) {
- metablob->add_dir_context(straydn->get_dir());
- metablob->add_dir(straydn->get_dir(), true);
+ if (destdnl->is_primary()) {
+ assert(straydn);
+ if (straydn->is_auth()) {
+ metablob->add_dir_context(straydn->get_dir());
+ metablob->add_dir(straydn->get_dir(), true);
+ }
}
// sub off target