From: Troy Mitchell <troy.mitchell@linux.spacemit.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Yixun Lan <dlan@gentoo.org>,
Jinmei Wei <weijinmei@linux.spacemit.com>
Cc: linux-sound@vger.kernel.org, linux-riscv@lists.infradead.org,
spacemit@lists.linux.dev, linux-kernel@vger.kernel.org,
Troy Mitchell <troy.mitchell@linux.spacemit.com>,
Dan Carpenter <dan.carpenter@linaro.org>
Subject: [PATCH v2 1/2] ASoC: spacemit: add failure check for spacemit_i2s_init_dai()
Date: Tue, 28 Oct 2025 09:32:09 +0800 [thread overview]
Message-ID: <20251028-fix-k1-i2s-v2-1-a547c15ed5c3@linux.spacemit.com> (raw)
In-Reply-To: <20251028-fix-k1-i2s-v2-0-a547c15ed5c3@linux.spacemit.com>
Add error handling when memory allocation for dai fails in
spacemit_i2s_init_dai() call.
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/aPtiNCZ_KBezL2Dr@stanley.mountain/#t
Fixes: fce217449075 ("ASoC: spacemit: add i2s support for K1 SoC")
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
---
Changelog in v2:
- fix tag
- Link to v1: https://lore.kernel.org/all/20251024-fix-k1-i2s-dai-mem-v1-1-15f5f1ec294a@linux.spacemit.com/
---
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,
--
2.51.1
next prev parent reply other threads:[~2025-10-28 1:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 1:32 [PATCH v2 0/2] ASoC: spacemit: fix build warning and error Troy Mitchell
2025-10-28 1:32 ` Troy Mitchell [this message]
2025-10-28 1:32 ` [PATCH v2 2/2] ASoC: spacemit: use `depends on` instead of `select` Troy Mitchell
2025-10-28 14:27 ` [PATCH v2 0/2] ASoC: spacemit: fix build warning and error Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251028-fix-k1-i2s-v2-1-a547c15ed5c3@linux.spacemit.com \
--to=troy.mitchell@linux.spacemit.com \
--cc=broonie@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=dlan@gentoo.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=spacemit@lists.linux.dev \
--cc=tiwai@suse.com \
--cc=weijinmei@linux.spacemit.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®