Skip to content

Commit

Permalink
scsi: hisi_sas: Check devm_add_action() return value
Browse files Browse the repository at this point in the history
[ Upstream commit 06d1a90 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Kang Chen authored and Greg Kroah-Hartman committed Mar 30, 2023
1 parent 83e7b1d commit 0267cd0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
Original file line number Diff line number Diff line change
@@ -2424,8 +2424,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)

0 comments on commit 0267cd0

Please sign in to comment.