scsi: hisi_sas: Check devm_add_action() return value

ANBZ: #11194

commit 665bd8adbdf2c3dfeb358bfa5f38b886ea4c4b3d openeuler

stable inclusion
from stable-v5.10.177
commit 522314863f7820f49ea80a8fb9d9e5526a578d9a
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I88YNP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=522314863f7820f49ea80a8fb9d9e5526a578d9a

--------------------------------

[ Upstream commit 06d1a90de6 ]

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>
Signed-off-by: sanglipeng <sanglipeng1@jd.com>
Signed-off-by: Slim6882 <yangjunshuo@huawei.com>
Signed-off-by: Min Li <gumi@linux.alibaba.com>
Reviewed-by: Guixin Liu <kanie@linux.alibaba.com>
Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Xunlei Pang <xlpang@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/4229
This commit is contained in:
Kang Chen 2023-02-27 11:10:30 +08:00 committed by 小龙
parent c5df577e38
commit 09d0fc9a92
1 changed files with 1 additions and 2 deletions

View File

@ -2524,8 +2524,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)