Skip to content

Commit e56efe9

Browse files
Colin Ian KingJ. Bruce Fields
authored andcommitted
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: Colin Ian King <colin.king@canonical.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent dadf3e4 commit e56efe9

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎fs/lockd/svclock.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -870,15 +870,15 @@ nlmsvc_grant_reply(struct nlm_cookie *cookie, __be32 status)
870870
if (!(block = nlmsvc_find_block(cookie)))
871871
return;
872872

873-
if (block) {
874-
if (status == nlm_lck_denied_grace_period) {
875-
/* Try again in a couple of seconds */
876-
nlmsvc_insert_block(block, 10 * HZ);
877-
} else {
878-
/* Lock is now held by client, or has been rejected.
879-
* In both cases, the block should be removed. */
880-
nlmsvc_unlink_block(block);
881-
}
873+
if (status == nlm_lck_denied_grace_period) {
874+
/* Try again in a couple of seconds */
875+
nlmsvc_insert_block(block, 10 * HZ);
876+
} else {
877+
/*
878+
* Lock is now held by client, or has been rejected.
879+
* In both cases, the block should be removed.
880+
*/
881+
nlmsvc_unlink_block(block);
882882
}
883883
nlmsvc_release_block(block);
884884
}

0 commit comments

Comments
 (0)