Commit 19c05072 authored by Thomas Meyer's avatar Thomas Meyer Committed by Martin K. Petersen

scsi: megaraid_sas: NULL check before some freeing functions is not needed

NULL check before some freeing functions is not needed.
Signed-off-by: default avatarThomas Meyer <thomas@m3y3r.de>
Acked-by: default avatarSumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c4e521b6
...@@ -1243,7 +1243,6 @@ megaraid_mbox_teardown_dma_pools(adapter_t *adapter) ...@@ -1243,7 +1243,6 @@ megaraid_mbox_teardown_dma_pools(adapter_t *adapter)
dma_pool_free(raid_dev->sg_pool_handle, sg_pci_blk[i].vaddr, dma_pool_free(raid_dev->sg_pool_handle, sg_pci_blk[i].vaddr,
sg_pci_blk[i].dma_addr); sg_pci_blk[i].dma_addr);
} }
if (raid_dev->sg_pool_handle)
dma_pool_destroy(raid_dev->sg_pool_handle); dma_pool_destroy(raid_dev->sg_pool_handle);
...@@ -1252,7 +1251,6 @@ megaraid_mbox_teardown_dma_pools(adapter_t *adapter) ...@@ -1252,7 +1251,6 @@ megaraid_mbox_teardown_dma_pools(adapter_t *adapter)
dma_pool_free(raid_dev->epthru_pool_handle, dma_pool_free(raid_dev->epthru_pool_handle,
epthru_pci_blk[i].vaddr, epthru_pci_blk[i].dma_addr); epthru_pci_blk[i].vaddr, epthru_pci_blk[i].dma_addr);
} }
if (raid_dev->epthru_pool_handle)
dma_pool_destroy(raid_dev->epthru_pool_handle); dma_pool_destroy(raid_dev->epthru_pool_handle);
...@@ -1261,7 +1259,6 @@ megaraid_mbox_teardown_dma_pools(adapter_t *adapter) ...@@ -1261,7 +1259,6 @@ megaraid_mbox_teardown_dma_pools(adapter_t *adapter)
dma_pool_free(raid_dev->mbox_pool_handle, dma_pool_free(raid_dev->mbox_pool_handle,
mbox_pci_blk[i].vaddr, mbox_pci_blk[i].dma_addr); mbox_pci_blk[i].vaddr, mbox_pci_blk[i].dma_addr);
} }
if (raid_dev->mbox_pool_handle)
dma_pool_destroy(raid_dev->mbox_pool_handle); dma_pool_destroy(raid_dev->mbox_pool_handle);
return; return;
......
...@@ -1017,7 +1017,6 @@ mraid_mm_register_adp(mraid_mmadp_t *lld_adp) ...@@ -1017,7 +1017,6 @@ mraid_mm_register_adp(mraid_mmadp_t *lld_adp)
kfree(adapter->kioc_list); kfree(adapter->kioc_list);
kfree(adapter->mbox_list); kfree(adapter->mbox_list);
if (adapter->pthru_dma_pool)
dma_pool_destroy(adapter->pthru_dma_pool); dma_pool_destroy(adapter->pthru_dma_pool);
kfree(adapter); kfree(adapter);
......
...@@ -807,9 +807,7 @@ megasas_free_rdpq_fusion(struct megasas_instance *instance) { ...@@ -807,9 +807,7 @@ megasas_free_rdpq_fusion(struct megasas_instance *instance) {
} }
if (fusion->reply_frames_desc_pool)
dma_pool_destroy(fusion->reply_frames_desc_pool); dma_pool_destroy(fusion->reply_frames_desc_pool);
if (fusion->reply_frames_desc_pool_align)
dma_pool_destroy(fusion->reply_frames_desc_pool_align); dma_pool_destroy(fusion->reply_frames_desc_pool_align);
if (fusion->rdpq_virt) if (fusion->rdpq_virt)
...@@ -830,7 +828,6 @@ megasas_free_reply_fusion(struct megasas_instance *instance) { ...@@ -830,7 +828,6 @@ megasas_free_reply_fusion(struct megasas_instance *instance) {
fusion->reply_frames_desc[0], fusion->reply_frames_desc[0],
fusion->reply_frames_desc_phys[0]); fusion->reply_frames_desc_phys[0]);
if (fusion->reply_frames_desc_pool)
dma_pool_destroy(fusion->reply_frames_desc_pool); dma_pool_destroy(fusion->reply_frames_desc_pool);
} }
...@@ -1623,7 +1620,6 @@ static inline void megasas_free_ioc_init_cmd(struct megasas_instance *instance) ...@@ -1623,7 +1620,6 @@ static inline void megasas_free_ioc_init_cmd(struct megasas_instance *instance)
fusion->ioc_init_cmd->frame, fusion->ioc_init_cmd->frame,
fusion->ioc_init_cmd->frame_phys_addr); fusion->ioc_init_cmd->frame_phys_addr);
if (fusion->ioc_init_cmd)
kfree(fusion->ioc_init_cmd); kfree(fusion->ioc_init_cmd);
} }
......
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