Skip to contentSkip to conversation

scsi: lpfc: Fix NULL check before mempool_destroy is not needed

PATCH Applied James Smart 2 participants 2 messages Oct 28, 2019 – Oct 29, 2019 1 message not in the archive SCSI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20191026194712.GA22249@saurav

James Smart

author Reviewed-by
#1 lore raw
Quoted 13 lines · Saurav Girepunje

mempool_destroy has taken null pointer check into account. so remove the redundant check.

---
  drivers/scsi/lpfc/lpfc_init.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/lpfc/lpfc_init.c +0 -0
index e91377a4cafe..f620ecae3428 100644

drivers/scsi/lpfc/lpfc_init.c lpfc_sli4_oas_verify(struct lpfc_hba *phba) · line 13352

Quoted 9 lines
drivers/scsi/lpfc/lpfc_init.c +1 -2
@@ -13346,8 +13346,7 @@ lpfc_sli4_oas_verify(struct lpfc_hba *phba)
  		phba->cfg_fof = 1;
  	} else {
  		phba->cfg_fof = 0;
-		if (phba->device_data_mem_pool)
-			mempool_destroy(phba->device_data_mem_pool);
+		mempool_destroy(phba->device_data_mem_pool);
  		phba->device_data_mem_pool = NULL;
  	}
 

Looks fine.

Thanks

-- james