From: Troy Mitchell Date: Fri, 24 Oct 2025 13:11:01 +0000 (+0800) Subject: ASoC: spacemit: add failure check for spacemit_i2s_init_dai() X-Git-Tag: v6.19-rc1~156^2~3^2~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f034c16a4663eaf3198dc18b201ba50533fb5b81;p=thirdparty%2Fkernel%2Flinux.git 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 Reported-by: Dan Carpenter Closes: tag. It would be easy to make the argument that the Link: https://patch.msgid.link/20251024-fix-k1-i2s-dai-mem-v1-1-15f5f1ec294a@linux.spacemit.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/spacemit/k1_i2s.c b/sound/soc/spacemit/k1_i2s.c index abc439b53e3d4..8af05e1604f51 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,