diff mbox series

[1/2] scsi: mpi3mr: delete unnecessary NULL check

Message ID YMCJKgykDYtyvY44@mwanda
State New
Headers show
Series [1/2] scsi: mpi3mr: delete unnecessary NULL check | expand

Commit Message

Dan Carpenter June 9, 2021, 9:26 a.m. UTC
The "mrioc->intr_info" pointer can't be NULL, but if it could then the
second iteration through the loop would Oops.  Let's delete the
confusing and impossible NULL check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/scsi/mpi3mr/mpi3mr_fw.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Martin K. Petersen June 16, 2021, 3:48 a.m. UTC | #1
On Wed, 9 Jun 2021 12:26:02 +0300, Dan Carpenter wrote:

> The "mrioc->intr_info" pointer can't be NULL, but if it could then the

> second iteration through the loop would Oops.  Let's delete the

> confusing and impossible NULL check.


Applied to 5.14/scsi-queue, thanks!

[1/2] scsi: mpi3mr: delete unnecessary NULL check
      https://git.kernel.org/mkp/scsi/c/d46bdecd9f3c
[2/2] scsi: mpi3mr: Fix error handling in mpi3mr_setup_isr()
      https://git.kernel.org/mkp/scsi/c/2938bedd0efa

-- 
Martin K. Petersen	Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
index acb2be62080a..40696b75345d 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
@@ -3583,8 +3583,7 @@  static void mpi3mr_free_mem(struct mpi3mr_ioc *mrioc)
 
 	for (i = 0; i < mrioc->intr_info_count; i++) {
 		intr_info = mrioc->intr_info + i;
-		if (intr_info)
-			intr_info->op_reply_q = NULL;
+		intr_info->op_reply_q = NULL;
 	}
 
 	kfree(mrioc->req_qinfo);