CID 716919 (#1 of 1): Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointer "cap" to function
"Capability::inc_suppress()", which dereferences it.
Check for 'cap' before use it as in other places of the function.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
dout(10) << " i want to change file_max, but lock won't allow it (yet)" << dendl;
if (in->filelock.is_stable()) {
bool need_issue = false;
- cap->inc_suppress();
+ if (cap)
+ cap->inc_suppress();
if (in->mds_caps_wanted.empty() &&
(in->get_loner() >= 0 || (in->get_wanted_loner() >= 0 && in->try_set_loner()))) {
if (in->filelock.get_state() != LOCK_EXCL)
simple_lock(&in->filelock, &need_issue);
if (need_issue)
issue_caps(in);
- cap->dec_suppress();
+ if (cap)
+ cap->dec_suppress();
}
if (!in->filelock.can_wrlock(client) &&
!in->filelock.can_force_wrlock(client)) {