Skip to contentSkip to conversation

scsi: hisi_sas: add a check of devm_add_action

PATCH Applied void0red 3 participants 3 messages Feb 27, 2023 – Mar 7, 2023

Subsystems (2)
lore
Share & tools
lore

void0red

author
#0 lore raw

PATCH 1/1 scsi: hisi_sas: add a check of devm_add_action

From: Kang Chen <[email protected]>

devm_add_action may fails, check it in the caller of interrupt_preinit_v3_hw

---
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +1 -2
index 0c3fcb807..a63279f55 100644
@@ -2495,8 +2495,7 @@ static int interrupt_preinit_v3_hw(struct hisi_hba *hisi_hba)
 	hisi_hba->cq_nvecs = vectors - BASE_VECTORS_V3_HW;
 	shost->nr_hw_queues = hisi_hba->cq_nvecs;
 
-	devm_add_action(&pdev->dev, hisi_sas_v3_free_vectors, pdev);
-	return 0;
+	return devm_add_action(&pdev->dev, hisi_sas_v3_free_vectors, pdev);
 }
 
 static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba)
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 6 lines · 在 2023/2/27 11:10, void0red 写道:

From: Kang Chen <[email protected]>

devm_add_action may fails, check it in the caller of interrupt_preinit_v3_hw

Thanks!

Quoted 18 lines
---
  drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +1 -2
index 0c3fcb807..a63279f55 100644
@@ -2495,8 +2495,7 @@ static int interrupt_preinit_v3_hw(struct hisi_hba *hisi_hba)
  	hisi_hba->cq_nvecs = vectors - BASE_VECTORS_V3_HW;
  	shost->nr_hw_queues = hisi_hba->cq_nvecs;
 
-	devm_add_action(&pdev->dev, hisi_sas_v3_free_vectors, pdev);
-	return 0;
+	return devm_add_action(&pdev->dev, hisi_sas_v3_free_vectors, pdev);
  }
 
  static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba)