From: sashiko-bot@kernel.org
To: phucduc.bui@gmail.com
Cc: Frank.Li@kernel.org, imx@lists.linux.dev
Subject: Re: [PATCH v3 1/2] usb: chipidea: ci_hdrc_imx: Propagate errors from optional IRQ lookup
Date: Mon, 10 Aug 2026 09:46:26 +0000 [thread overview]
Message-ID: <20260810094626.DA02F1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260810093112.47807-1-phucduc.bui@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] If `devm_kasprintf()` fails to allocate memory for `irq_name`, `dev_err_probe()` is called but its return value is not assigned to `ret`. Since `ret` is `0` at this point, the probe function incorrectly returns `0` (success) despite the failure, leaving the device in a broken, partially initialized state.
--
--- Patch [1]: [PATCH v3 1/2] usb: chipidea: ci_hdrc_imx: Propagate errors from optional IRQ lookup ---
commit bd6ce4edd163bb35e7e3be5ae05ae52d0c380e8a
Author: bui duc phuc <phucduc.bui@gmail.com>
usb: chipidea: ci_hdrc_imx: Propagate errors from optional IRQ lookup
This commit updates ci_hdrc_imx_probe() to propagate errors returned from
platform_get_irq_optional(). Instead of continuing without an IRQ on
failures like -EPROBE_DEFER or -EINVAL, the driver now properly aborts
and returns the error.
> diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
> index 56d2ba824a0b2..9e529398c6075 100644
> --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> @@ -525,6 +525,10 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
> data->supports_runtime_pm = true;
>
> data->wakeup_irq = platform_get_irq_optional(pdev, 1);
> + if (data->wakeup_irq < 0 && data->wakeup_irq != -ENXIO) {
> + ret = data->wakeup_irq;
> + goto phy_shutdown;
> + }
> if (data->wakeup_irq > 0) {
> irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s:wakeup", pdata.name);
> if (!irq_name) {
[Severity: High]
This is a pre-existing issue, but missing an assignment to ret here causes
the probe to falsely succeed:
drivers/usb/chipidea/ci_hdrc_imx.c:ci_hdrc_imx_probe() {
...
if (data->wakeup_irq > 0) {
irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s:wakeup", pdata.name);
if (!irq_name) {
dev_err_probe(dev, -ENOMEM, "failed to create irq_name\n");
goto err_clk;
}
...
}
Because dev_err_probe() is called but its return value is not assigned to
ret, and ret is 0 at this point, the probe function incorrectly returns 0
(success) despite the memory allocation failure.
Does this code need to assign the error to ret before jumping to err_clk?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260810093112.47807-1-phucduc.bui@gmail.com?part=1
next prev parent reply other threads:[~2026-08-10 9:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 9:31 [PATCH v3 1/2] usb: chipidea: ci_hdrc_imx: Propagate errors from optional IRQ lookup phucduc.bui
2026-08-10 9:31 ` [PATCH v3 2/2] usb: chipidea: ci_hdrc_imx: Fix error handling when creating IRQ name phucduc.bui
2026-08-10 9:46 ` sashiko-bot [this message]
2026-08-10 10:25 ` [PATCH v3 1/2] usb: chipidea: ci_hdrc_imx: Propagate errors from optional IRQ lookup Bui Duc Phuc
2026-08-10 19:04 ` Frank Li
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=20260810094626.DA02F1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=imx@lists.linux.dev \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox