dma_pool_destroy() can handle NULL pointer correctly, so there is no need to check NULL pointer before calling dma_pool_destroy(). Signed-off-by: Chengguang Xu <cgxu519@xxxxxxx> --- drivers/scsi/megaraid/megaraid_mm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c index 8428247015db..ee870bba15ef 100644 --- a/drivers/scsi/megaraid/megaraid_mm.c +++ b/drivers/scsi/megaraid/megaraid_mm.c @@ -1016,10 +1016,7 @@ mraid_mm_register_adp(mraid_mmadp_t *lld_adp) kfree(adapter->kioc_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); return rval; -- 2.17.2