Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e56efe93 authored by Colin Ian King's avatar Colin Ian King Committed by J. Bruce Fields
Browse files

lockd: remove redundant check on block



A null check followed by a return is being performed already, so block
is always non-null at the second check on block, hence we can remove
this redundant null-check (Detected by PVS-Studio).  Also re-work
comment to clean up a check-patch warning.

Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent dadf3e43
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -870,16 +870,16 @@ nlmsvc_grant_reply(struct nlm_cookie *cookie, __be32 status)
	if (!(block = nlmsvc_find_block(cookie)))
		return;

	if (block) {
	if (status == nlm_lck_denied_grace_period) {
		/* Try again in a couple of seconds */
		nlmsvc_insert_block(block, 10 * HZ);
	} else {
			/* Lock is now held by client, or has been rejected.
			 * In both cases, the block should be removed. */
		/*
		 * Lock is now held by client, or has been rejected.
		 * In both cases, the block should be removed.
		 */
		nlmsvc_unlink_block(block);
	}
	}
	nlmsvc_release_block(block);
}