[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251024-fix-k1-i2s-dai-mem-v1-1-15f5f1ec294a@linux.spacemit.com>
Date: Fri, 24 Oct 2025 21:11:01 +0800
From: Troy Mitchell <troy.mitchell@...ux.spacemit.com>
To: Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
Yixun Lan <dlan@...too.org>
Cc: linux-sound@...r.kernel.org, linux-riscv@...ts.infradead.org,
spacemit@...ts.linux.dev, linux-kernel@...r.kernel.org,
Troy Mitchell <troy.mitchell@...ux.spacemit.com>,
Dan Carpenter <dan.carpenter@...aro.org>
Subject: [PATCH] ASoC: spacemit: add failure check for
spacemit_i2s_init_dai()
Add error handling when memory allocation for dai fails in
spacemit_i2s_init_dai() call.
Signed-off-by: Troy Mitchell <troy.mitchell@...ux.spacemit.com>
Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
---
Dan reported here [1].
Link: https://lore.kernel.org/all/aPtiNCZ_KBezL2Dr@stanley.mountain/#t [1]
---
sound/soc/spacemit/k1_i2s.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/soc/spacemit/k1_i2s.c b/sound/soc/spacemit/k1_i2s.c
index abc439b53e3d4358570df2e69e636bf54820d9ce..8af05e1604f518b63cbbbaa66b73cfee8262d87f 100644
--- a/sound/soc/spacemit/k1_i2s.c
+++ b/sound/soc/spacemit/k1_i2s.c
@@ -428,7 +428,9 @@ static int spacemit_i2s_probe(struct platform_device *pdev)
dev_set_drvdata(i2s->dev, i2s);
- spacemit_i2s_init_dai(i2s, &dai, res->start + SSDATR);
+ ret = spacemit_i2s_init_dai(i2s, &dai, res->start + SSDATR);
+ if (ret)
+ return ret;
ret = devm_snd_soc_register_component(i2s->dev,
&spacemit_i2s_component,
---
base-commit: 72fb0170ef1f45addf726319c52a0562b6913707
change-id: 20251024-fix-k1-i2s-dai-mem-7a1814edc67d
Best regards,
--
Troy Mitchell <troy.mitchell@...ux.spacemit.com>
Powered by blists - more mailing lists