From: sashiko-bot@kernel.org
To: "Xianwei Zhao" <xianwei.zhao@amlogic.com>
Cc: linux-amlogic@lists.infradead.org, dmaengine@vger.kernel.org,
vkoul@kernel.org, Frank.Li@kernel.org, neil.armstrong@linaro.org
Subject: Re: [PATCH] dmaengine: amlogic: Fix regmap error check issue
Date: Fri, 16 Oct 2026 03:08:25 +0000 [thread overview]
Message-ID: <sashiko-outbox-173653@kernel.org> (raw)
In-Reply-To: <20261016-fix-a9-dma-complier-v1-1-024421d5b3c8@amlogic.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dmaengine: amlogic: free_wq leaked on error paths in aml_dma_probe()
--
commit 84261163c6f208aa12834ec242da34b3d805e7ad
Author: Xianwei Zhao <xianwei.zhao@amlogic.com>
dmaengine: amlogic: Fix regmap error check issue
This commit changes the error check for devm_regmap_init_mmio() to use
IS_ERR() instead of IS_ERR_OR_NULL(). This resolves a Smatch warning about
passing zero to PTR_ERR().
Closes: https://lore.kernel.org/r/202610080953.C5TYlCaA-lkp@intel.com/
> diff --git a/drivers/dma/amlogic-dma.c b/drivers/dma/amlogic-dma.c
> index 78ee2337ae712..684121d13fcab 100644
> --- a/drivers/dma/amlogic-dma.c
> +++ b/drivers/dma/amlogic-dma.c
> @@ -632,7 +632,7 @@ static int aml_dma_probe(struct platform_device *pdev)
>
> aml_dma->regmap = devm_regmap_init_mmio(&pdev->dev, aml_dma->base,
> &aml_regmap_config);
> - if (IS_ERR_OR_NULL(aml_dma->regmap))
> + if (IS_ERR(aml_dma->regmap))
> return PTR_ERR(aml_dma->regmap);
[Severity: Medium]
Does this code leak the free_wq workqueue on this error path?
aml_dma->free_wq is allocated earlier in aml_dma_probe() using
alloc_ordered_workqueue(), which isn't managed by devres:
drivers/dma/amlogic-dma.c:aml_dma_probe() {
...
aml_dma->free_wq = alloc_ordered_workqueue("aml_dma_free", 0);
if (!aml_dma->free_wq)
return -ENOMEM;
...
}
If devm_regmap_init_mmio() fails and we return directly here, there is
no cleanup for the allocated workqueue.
>
> aml_dma->clk = devm_clk_get_enabled(&pdev->dev, NULL);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261016-fix-a9-dma-complier-v1-1-024421d5b3c8@amlogic.com?part=1
next prev parent reply other threads:[~2026-10-16 3:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 3:00 [PATCH] dmaengine: amlogic: Fix regmap error check issue Xianwei Zhao via B4 Relay
2026-10-16 3:08 ` sashiko-bot [this message]
2026-10-16 6:41 ` Xianwei Zhao
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-173653@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vkoul@kernel.org \
--cc=xianwei.zhao@amlogic.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