mpt3sas: Fix Coverity reported issue.

Message ID 20210618155506.2609112-1-suganath-prabu.subramani@broadcom.com
State New
Headers show
Series
  • mpt3sas: Fix Coverity reported issue.
Related show

Commit Message

Suganath Prabu S June 18, 2021, 3:55 p.m.
Fix the Structurally dead code (UNREACHABLE) type of error
reported by coverity.

Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen June 19, 2021, 2:47 a.m. | #1
Suganath,

> Fix the Structurally dead code (UNREACHABLE) type of error reported by
> coverity.

Applied to 5.14/scsi-staging, thanks!

Patch

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index e592b1a..75e5c6c 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -7206,6 +7206,7 @@  mpt3sas_port_enable_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
 		ioc->port_enable_failed = 1;
 
 	if (ioc->port_enable_cmds.status & MPT3_CMD_COMPLETE_ASYNC) {
+		ioc->port_enable_cmds.status &= ~MPT3_CMD_COMPLETE_ASYNC;
 		if (ioc_status == MPI2_IOCSTATUS_SUCCESS) {
 			mpt3sas_port_enable_complete(ioc);
 			return 1;
@@ -7214,7 +7215,6 @@  mpt3sas_port_enable_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
 			ioc->start_scan = 0;
 			return 1;
 		}
-		ioc->port_enable_cmds.status &= ~MPT3_CMD_COMPLETE_ASYNC;
 	}
 	complete(&ioc->port_enable_cmds.done);
 	return 1;