scsi: hisi_sas: add a check of devm_add_action
Subsystems (2)
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
Signed-off-by Kang Chen <[email protected]>
--- 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
@@ -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
Hi,
Quoted 6 lines · 在 2023/2/27 11:10, void0red 写道:
From: Kang Chen <[email protected]>
devm_add_actionmay fails, check it in the caller ofinterrupt_preinit_v3_hwSigned-off-by Kang Chen <[email protected]>
Acked-by Xiang Chen <[email protected]>
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@@ -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)
Martin K. Petersen
AppliedQuoted 4 lines · On Mon, 27 Feb 2023 11:10:30 +0800, void0red wrote:
devm_add_actionmay fails, check it in the caller ofinterrupt_preinit_v3_hw
Applied to 6.3/scsi-fixes, thanks!
[1/1] scsi: hisi_sas: add a check of devm_add_action
https://git.kernel.org/mkp/scsi/c/06d1a90de602
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering