Commit 56e5ad1e authored by Maurizio Lombardi's avatar Maurizio Lombardi Committed by Greg Kroah-Hartman

megaraid: fix null pointer check in megasas_detach_one().

commit 546e559c upstream.

The pd_seq_sync pointer can't be NULL, we have to check its entries
instead.
Signed-off-by: default avatarMaurizio Lombardi <mlombard@redhat.com>
Acked-by: default avatarSumit Saxena <sumit.saxena@broadcom.com>
Reviewed-by: default avatarTomas Henzl <thenzl@redhat.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e3718ed1
...@@ -5941,11 +5941,11 @@ static void megasas_detach_one(struct pci_dev *pdev) ...@@ -5941,11 +5941,11 @@ static void megasas_detach_one(struct pci_dev *pdev)
if (fusion->ld_drv_map[i]) if (fusion->ld_drv_map[i])
free_pages((ulong)fusion->ld_drv_map[i], free_pages((ulong)fusion->ld_drv_map[i],
fusion->drv_map_pages); fusion->drv_map_pages);
if (fusion->pd_seq_sync) if (fusion->pd_seq_sync[i])
dma_free_coherent(&instance->pdev->dev, dma_free_coherent(&instance->pdev->dev,
pd_seq_map_sz, pd_seq_map_sz,
fusion->pd_seq_sync[i], fusion->pd_seq_sync[i],
fusion->pd_seq_phys[i]); fusion->pd_seq_phys[i]);
} }
free_pages((ulong)instance->ctrl_context, free_pages((ulong)instance->ctrl_context,
instance->ctrl_context_pages); instance->ctrl_context_pages);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment