From: Maurizio Lombardi <mlombard@redhat.com>
To: sumit.saxena@avagotech.com
Cc: kashyap.desai@avagotech.com, uday.lingala@avagotech.com,
linux-scsi@vger.kernel.org, jbottomley@parallels.com,
thenzl@redhat.com
Subject: [PATCH] megaraid: fix null pointer check in megasas_detach_one().
Date: Fri, 22 Jan 2016 13:41:42 +0100 [thread overview]
Message-ID: <1453466502-9335-1-git-send-email-mlombard@redhat.com> (raw)
The pd_seq_sync pointer can't be NULL, we have to check
its entries instead.
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
drivers/scsi/megaraid/megaraid_sas_base.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 97a1c1c..f083e74 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -5941,11 +5941,11 @@ static void megasas_detach_one(struct pci_dev *pdev)
if (fusion->ld_drv_map[i])
free_pages((ulong)fusion->ld_drv_map[i],
fusion->drv_map_pages);
- if (fusion->pd_seq_sync)
- dma_free_coherent(&instance->pdev->dev,
- pd_seq_map_sz,
- fusion->pd_seq_sync[i],
- fusion->pd_seq_phys[i]);
+ if (fusion->pd_seq_sync[i])
+ dma_free_coherent(&instance->pdev->dev,
+ pd_seq_map_sz,
+ fusion->pd_seq_sync[i],
+ fusion->pd_seq_phys[i]);
}
free_pages((ulong)instance->ctrl_context,
instance->ctrl_context_pages);
--
Maurizio Lombardi
next reply other threads:[~2016-01-22 12:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-22 12:41 Maurizio Lombardi [this message]
2016-02-02 1:53 ` [PATCH] megaraid: fix null pointer check in megasas_detach_one() Martin K. Petersen
2016-02-03 4:42 ` Sumit Saxena
2016-02-04 2:36 ` Martin K. Petersen
2016-02-05 12:34 ` Sumit Saxena
2016-02-04 15:12 ` Tomas Henzl
2016-02-05 3:24 ` 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=1453466502-9335-1-git-send-email-mlombard@redhat.com \
--to=mlombard@redhat.com \
--cc=jbottomley@parallels.com \
--cc=kashyap.desai@avagotech.com \
--cc=linux-scsi@vger.kernel.org \
--cc=sumit.saxena@avagotech.com \
--cc=thenzl@redhat.com \
--cc=uday.lingala@avagotech.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).