From: Dan Carpenter <dan.carpenter@oracle.com>
To: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
Hannes Reinecke <hare@suse.de>, Tomas Henzl <thenzl@redhat.com>,
Kashyap Desai <kashyap.desai@broadcom.com>,
Himanshu Madhani <himanshu.madhani@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH 1/2] scsi: mpi3mr: delete unnecessary NULL check
Date: Wed, 9 Jun 2021 12:26:02 +0300 [thread overview]
Message-ID: <YMCJKgykDYtyvY44@mwanda> (raw)
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(-)
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);
--
2.30.2
next reply other threads:[~2021-06-09 9:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-09 9:26 Dan Carpenter [this message]
2021-06-10 3:01 ` [PATCH 1/2] scsi: mpi3mr: delete unnecessary NULL check Martin K. Petersen
2021-06-16 3:48 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YMCJKgykDYtyvY44@mwanda \
--to=dan.carpenter@oracle.com \
--cc=hare@suse.de \
--cc=himanshu.madhani@oracle.com \
--cc=jejb@linux.ibm.com \
--cc=kashyap.desai@broadcom.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=thenzl@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).