Blob Blame History Raw
From: Colin Ian King <colin.king@canonical.com>
Date: Wed, 18 Nov 2020 13:37:44 +0000
Subject: scsi: lpfc: Remove dead code on second !ndlp check
Patch-mainline: v5.11-rc1
Git-commit: 61795a5316ad8786fb4bb896198733188a60eab8
References: bsc#1164780

Currently there is a null check on the pointer ndlp that exits via error
path issue_ct_rsp_exit followed by another null check on the same pointer
that is almost identical to the previous null check stanza and yet can
never can be reached because the previous check exited via
issue_ct_rsp_exit. This is deadcode and can be removed.

Link: https://lore.kernel.org/r/20201118133744.461385-1-colin.king@canonical.com
Reviewed-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Addresses-Coverity: ("Logically dead code")
Acked-by: Daniel Wagner <dwagner@suse.de>
---
 drivers/scsi/lpfc/lpfc_bsg.c |    6 ------
 1 file changed, 6 deletions(-)

--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -1530,12 +1530,6 @@ lpfc_issue_ct_rsp(struct lpfc_hba *phba,
 			goto issue_ct_rsp_exit;
 		}
 
-		/* Check if the ndlp is active */
-		if (!ndlp) {
-			rc = IOCB_ERROR;
-			goto issue_ct_rsp_exit;
-		}
-
 		/* get a refernece count so the ndlp doesn't go away while
 		 * we respond
 		 */