mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: spacemit: add failure check for spacemit_i2s_init_dai()
@ 2025-10-24 13:11 Troy Mitchell
  2025-10-24 14:13 ` Dan Carpenter
  2025-10-28 14:27 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Troy Mitchell @ 2025-10-24 13:11 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai, Yixun Lan
  Cc: linux-sound, linux-riscv, spacemit, linux-kernel, Troy Mitchell,
	Dan Carpenter

Add error handling when memory allocation for dai fails in
spacemit_i2s_init_dai() call.

Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.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@linux.spacemit.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: spacemit: add failure check for spacemit_i2s_init_dai()
  2025-10-24 13:11 [PATCH] ASoC: spacemit: add failure check for spacemit_i2s_init_dai() Troy Mitchell
@ 2025-10-24 14:13 ` Dan Carpenter
  2025-10-24 14:19   ` Troy Mitchell
  2025-10-28 14:27 ` Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2025-10-24 14:13 UTC (permalink / raw)
  To: Troy Mitchell
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Yixun Lan, linux-sound, linux-riscv, spacemit, linux-kernel

On Fri, Oct 24, 2025 at 09:11:01PM +0800, Troy Mitchell wrote:
> Add error handling when memory allocation for dai fails in
> spacemit_i2s_init_dai() call.
> 
> Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> Dan reported here [1].
> 
> Link: https://lore.kernel.org/all/aPtiNCZ_KBezL2Dr@stanley.mountain/#t [1]

Thanks, Troy

Normally we would say this needs a Fixes tag and the Link: should be a
Closes: tag.  It would be easy to make the argument that the
allocation won't fail in real life so a Fixes tag isn't appropriate.  But
actually it's simpler to add the tag...

regards,
dan carpenter



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: spacemit: add failure check for spacemit_i2s_init_dai()
  2025-10-24 14:13 ` Dan Carpenter
@ 2025-10-24 14:19   ` Troy Mitchell
  0 siblings, 0 replies; 4+ messages in thread
From: Troy Mitchell @ 2025-10-24 14:19 UTC (permalink / raw)
  To: Dan Carpenter, Troy Mitchell
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Yixun Lan, linux-sound, linux-riscv, spacemit, linux-kernel

On Fri, Oct 24, 2025 at 05:13:48PM +0300, Dan Carpenter wrote:
> On Fri, Oct 24, 2025 at 09:11:01PM +0800, Troy Mitchell wrote:
> > Add error handling when memory allocation for dai fails in
> > spacemit_i2s_init_dai() call.
> > 
> > Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
> > Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> > ---
> > Dan reported here [1].
> > 
> > Link: https://lore.kernel.org/all/aPtiNCZ_KBezL2Dr@stanley.mountain/#t [1]
> 
> Thanks, Troy
> 
> Normally we would say this needs a Fixes tag and the Link: should be a
> Closes: tag.  It would be easy to make the argument that the
> allocation won't fail in real life so a Fixes tag isn't appropriate.  But
> actually it's simpler to add the tag...
I see. Thanks!

Should I send v2 with Fixes tag now,
or would it be better to wait a bit?

                - Troy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: spacemit: add failure check for spacemit_i2s_init_dai()
  2025-10-24 13:11 [PATCH] ASoC: spacemit: add failure check for spacemit_i2s_init_dai() Troy Mitchell
  2025-10-24 14:13 ` Dan Carpenter
@ 2025-10-28 14:27 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-10-28 14:27 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Yixun Lan, Troy Mitchell
  Cc: linux-sound, linux-riscv, spacemit, linux-kernel, Dan Carpenter

On Fri, 24 Oct 2025 21:11:01 +0800, Troy Mitchell wrote:
> Add error handling when memory allocation for dai fails in
> spacemit_i2s_init_dai() call.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: spacemit: add failure check for spacemit_i2s_init_dai()
      commit: f034c16a4663eaf3198dc18b201ba50533fb5b81

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-28 14:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-24 13:11 [PATCH] ASoC: spacemit: add failure check for spacemit_i2s_init_dai() Troy Mitchell
2025-10-24 14:13 ` Dan Carpenter
2025-10-24 14:19   ` Troy Mitchell
2025-10-28 14:27 ` Mark Brown

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®