]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/6.6.26/asoc-amd-acp-fix-for-acp_init-function-error-handlin.patch
Linux 6.6.26
[thirdparty/kernel/stable-queue.git] / releases / 6.6.26 / asoc-amd-acp-fix-for-acp_init-function-error-handlin.patch
1 From ccbdea83babe2e0a83cdcaeb97f55426f7b4f1d6 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Fri, 29 Mar 2024 11:08:12 +0530
4 Subject: ASoC: amd: acp: fix for acp_init function error handling
5
6 From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
7
8 [ Upstream commit 2c603a4947a1247102ccb008d5eb6f37a4043c98 ]
9
10 If acp_init() fails, acp pci driver probe should return error.
11 Add acp_init() function return value check logic.
12
13 Fixes: e61b415515d3 ("ASoC: amd: acp: refactor the acp init and de-init sequence")
14 Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
15 Link: https://lore.kernel.org/r/20240329053815.2373979-1-Vijendar.Mukunda@amd.com
16 Signed-off-by: Mark Brown <broonie@kernel.org>
17 Signed-off-by: Sasha Levin <sashal@kernel.org>
18 ---
19 sound/soc/amd/acp/acp-pci.c | 5 ++++-
20 1 file changed, 4 insertions(+), 1 deletion(-)
21
22 diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c
23 index a32c14a109b77..223238f662f83 100644
24 --- a/sound/soc/amd/acp/acp-pci.c
25 +++ b/sound/soc/amd/acp/acp-pci.c
26 @@ -107,7 +107,10 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
27 goto unregister_dmic_dev;
28 }
29
30 - acp_init(chip);
31 + ret = acp_init(chip);
32 + if (ret)
33 + goto unregister_dmic_dev;
34 +
35 res = devm_kcalloc(&pci->dev, num_res, sizeof(struct resource), GFP_KERNEL);
36 if (!res) {
37 ret = -ENOMEM;
38 --
39 2.43.0
40