scsi: hisi_sas: Check devm_add_action() return value
authorKang Chen <void0red@gmail.com>
Mon, 27 Feb 2023 03:10:30 +0000 (11:10 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 6 Mar 2023 23:33:12 +0000 (18:33 -0500)
In case devm_add_action() fails, check it in the caller of
interrupt_preinit_v3_hw().

Link: https://lore.kernel.org/r/20230227031030.893324-1-void0red@gmail.com
Signed-off-by: Kang Chen <void0red@gmail.com>
Acked-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

index 0c3fcb8078062b9ad7e44c7a987076042adfabb6..a63279f55d09607488d7784d2d8666375de62c3e 100644 (file)
@@ -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)