All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: phucduc.bui@gmail.com
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH 5/5] ASoC: dwc: Remove redundant error messages
Date: Fri, 06 Nov 2026 11:43:22 +0000	[thread overview]
Message-ID: <sashiko-outbox-201333@kernel.org> (raw)
In-Reply-To: <20261106112940.53550-6-phucduc.bui@gmail.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Critical] ASoC: dwc: use-after-free in jh7110_i2s_crg_master_init()
  [1]
--

commit 5c9147e66967380d8d14ec0323b003b6d572821e
Author: bui duc phuc <phucduc.bui@gmail.com>

ASoC: dwc: Remove redundant error messages

This commit removes dev_err_probe() and dev_err() calls in the DesignWare I2S
driver where the underlying helper functions already log errors on failure.

> diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c
> index 1ff5b6f8864d6..87b47661e4698 100644
> --- a/sound/soc/dwc/dwc-i2s.c
> +++ b/sound/soc/dwc/dwc-i2s.c
> @@ -752,7 +752,7 @@ static int jh7110_i2s_crg_master_init(struct dw_i2s_dev *dev)
>  
>  	ret = clk_bulk_get(dev->dev, ARRAY_SIZE(clks), clks);
>  	if (ret)
> -		return dev_err_probe(dev->dev, ret, "failed to get i2s clocks\n");
> +		return ret;
>  
>  	mclk = clks[0].clk;
>  	mclk_ext = clks[1].clk;
> @@ -830,7 +830,7 @@ static int jh7110_i2s_crg_slave_init(struct dw_i2s_dev *dev)
>  
>  	ret = clk_bulk_get(dev->dev, ARRAY_SIZE(clks), clks);
>  	if (ret)
> -		return dev_err_probe(dev->dev, ret, "failed to get i2s clocks\n");
> +		return ret;
>  
>  	mclk = clks[0].clk;
>  	mclk_ext = clks[1].clk;

[Severity: Critical]
This problem wasn't introduced by this patch, but can concurrent probes
clobber the static clks[] arrays [1] in jh7110_i2s_crg_master_init()
and jh7110_i2s_crg_slave_init()?

Both functions declare their struct clk_bulk_data clks[] array as static,
so clk_bulk_get() writes per-device struct clk pointers into shared state.
If two I2S instances probe concurrently, one overwrites the other's clock
pointers in clks[], causing subsequent clk_bulk_put() calls to leak the
overwritten references and release the remaining ones multiple times,
leading to a use-after-free.

[1] https://sashiko.dev/#/bug/linux-89ddb741-fe78-4a6e-bfd0-66e1730f7ed2

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261106112940.53550-1-phucduc.bui@gmail.com?part=5

  reply	other threads:[~2026-11-06 11:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 11:29 [PATCH 0/5] Fix several issues in the DesignWare I2S driver phucduc.bui
2026-11-06 11:29 ` [PATCH 1/5] ASoC: dwc: Fix bit clock rate in TDM mode phucduc.bui
2026-11-09  7:10   ` Maxim Kochetkov
2026-11-10  6:53     ` Bui Duc Phuc
2026-11-06 11:29 ` [PATCH 2/5] ASoC: dwc: Fix error handling in dw_i2s_set_fmt() phucduc.bui
2026-11-09  7:19   ` Maxim Kochetkov
2026-11-10  6:55     ` Bui Duc Phuc
2026-11-06 11:29 ` [PATCH 3/5] ASoC: dwc: Fix channels_max derived from COMP_PARAM_1 phucduc.bui
2026-11-09  7:23   ` Maxim Kochetkov
2026-11-06 11:29 ` [PATCH 4/5] ASoC: dwc: Fix DMA fifo_size calculation phucduc.bui
2026-11-06 11:39   ` sashiko-bot
2026-11-06 11:29 ` [PATCH 5/5] ASoC: dwc: Remove redundant error messages phucduc.bui
2026-11-06 11:43   ` sashiko-bot [this message]
2026-11-09  5:01     ` Bui Duc Phuc
2026-11-08 14:05   ` Mark Brown
2026-11-09  2:59     ` Bui Duc Phuc

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=sashiko-outbox-201333@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=phucduc.bui@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.