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

Signed-off-by: Maurizio Lombardi <[email protected]>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to