diff mbox

megaraid: fix null pointer check in megasas_detach_one().

Message ID 1453466502-9335-1-git-send-email-mlombard@redhat.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Maurizio Lombardi Jan. 22, 2016, 12:41 p.m. UTC
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(-)

Comments

Martin K. Petersen Feb. 2, 2016, 1:53 a.m. UTC | #1
>>>>> "Maurizio" == Maurizio Lombardi <mlombard@redhat.com> writes:

Maurizio> The pd_seq_sync pointer can't be NULL, we have to check its
Maurizio> entries instead.

Sumit?
Sumit Saxena Feb. 3, 2016, 4:42 a.m. UTC | #2
> -----Original Message-----
> From: Martin K. Petersen [mailto:martin.petersen@oracle.com]
> Sent: Tuesday, February 02, 2016 7:24 AM
> To: Maurizio Lombardi
> Cc: sumit.saxena@avagotech.com; kashyap.desai@avagotech.com;
> uday.lingala@avagotech.com; linux-scsi@vger.kernel.org;
> jbottomley@parallels.com; thenzl@redhat.com
> Subject: Re: [PATCH] megaraid: fix null pointer check in
megasas_detach_one().
>
> >>>>> "Maurizio" == Maurizio Lombardi <mlombard@redhat.com> writes:
>
> Maurizio> The pd_seq_sync pointer can't be NULL, we have to check its
> Maurizio> entries instead.
>
> Sumit?
Martin,
Patch looks good but it needs to be rebased with latest repo as very
recently you have checked in few megaraid_sas patches and there are two
critical patches for megaraid_sas are yet pending.
Once we get status of those two outstanding patches, I will ask submitter
to rebase and send this patch again or I will be resending.

Thanks,
Sumit
>
> --
> Martin K. Petersen	Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Martin K. Petersen Feb. 4, 2016, 2:36 a.m. UTC | #3
>>>>> "Sumit" == Sumit Saxena <sumit.saxena@broadcom.com> writes:

Sumit,

Sumit> Patch looks good but it needs to be rebased with latest repo as
Sumit> very recently you have checked in few megaraid_sas patches and
Sumit> there are two critical patches for megaraid_sas are yet pending.

You still need to respond to Tomas' comments to:

[PATCH 1/2] megaraid_sas: Fix for IO failing post OCR in SRIOV environment

Sumit> Once we get status of those two outstanding patches, I will ask
Sumit> submitter to rebase and send this patch again or I will be
Sumit> resending.

Rebase? The patch fixes a bug and it applies cleanly. That's all that
matters.
Tomas Henzl Feb. 4, 2016, 3:12 p.m. UTC | #4
On 22.1.2016 13:41, Maurizio Lombardi wrote:
> The pd_seq_sync pointer can't be NULL, we have to check
> its entries instead.
>
> Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>

Reviewed-by: Tomas Henzl <thenzl@redhat.com>

Tomas

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Martin K. Petersen Feb. 5, 2016, 3:24 a.m. UTC | #5
>>>>> "Maurizio" == Maurizio Lombardi <mlombard@redhat.com> writes:

Maurizio> The pd_seq_sync pointer can't be NULL, we have to check its
Maurizio> entries instead.

Applied to 4.6/scsi-queue.
Sumit Saxena Feb. 5, 2016, 12:34 p.m. UTC | #6
> -----Original Message-----
> From: Martin K. Petersen [mailto:martin.petersen@oracle.com]
> Sent: Thursday, February 04, 2016 8:07 AM
> To: Sumit Saxena
> Cc: Martin K. Petersen; Maurizio Lombardi; sumit.saxena@broadcom.com;
> kashyap.desai@broadcom.com; uday.lingala@broadcom.com; linux-
> scsi@vger.kernel.org; James Bottomley; thenzl@redhat.com
> Subject: Re: [PATCH] megaraid: fix null pointer check in
megasas_detach_one().
>
> >>>>> "Sumit" == Sumit Saxena <sumit.saxena@broadcom.com> writes:
>
> Sumit,
>
> Sumit> Patch looks good but it needs to be rebased with latest repo as
> Sumit> very recently you have checked in few megaraid_sas patches and
> Sumit> there are two critical patches for megaraid_sas are yet pending.
>
> You still need to respond to Tomas' comments to:
>
> [PATCH 1/2] megaraid_sas: Fix for IO failing post OCR in SRIOV
environment

Sorry for delay. I responded to Tomas query.
>
> Sumit> Once we get status of those two outstanding patches, I will ask
> Sumit> submitter to rebase and send this patch again or I will be
> Sumit> resending.
>
> Rebase? The patch fixes a bug and it applies cleanly. That's all that
matters.
Ok, sorry for confusion. I was expecting those two critical patches
getting accepted before this patch as adding this patch first may cause
those 2 patches getting failed.
Anyways, this patch is committed now so if those 2 patches get applied
cleanly on top on new repo, that's well otherwise I may need to resend
those 2 patches.

Thanks,
Sumit
>
> --
> Martin K. Petersen	Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);