From: sashiko-bot@kernel.org
To: "Marc Kleine-Budde" <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org,
"Oliver Hartkopp" <socketcan@hartkopp.net>,
"Vincent Mailhol" <mailhol@kernel.org>,
"Oleksij Rempel" <o.rempel@pengutronix.de>
Subject: Re: [PATCH net-next 06/12] can: sun4i_can: don't discard the IRQ lookup error in probe
Date: Thu, 19 Nov 2026 09:32:27 +0000 [thread overview]
Message-ID: <sashiko-outbox-222848@kernel.org> (raw)
In-Reply-To: <20261118092955.1283165-7-mkl@pengutronix.de>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] can: sun4i_can: clk leak in sun4ican_probe() on IRQ deferral
and log mismatch
--
commit d88cf8d3dd8506848b42acf7070c915117b36839
Author: Chaosheng Qu <chaosheng.qu.linux@gmail.com>
can: sun4i_can: don't discard the IRQ lookup error in probe
This commit propagates the negative errno from platform_get_irq() in
sun4ican_probe() instead of overwriting it with -ENODEV so that deferred
probing can succeed once the interrupt controller is available.
Link: https://patch.msgid.link/2a7cb6e4e1b494efd4da512abbf307c19d9d1467.1792118040.git.chaosheng.qu.linux@gmail.com
> diff --git a/drivers/net/can/sun4i_can.c b/drivers/net/can/sun4i_can.c
> index af52285d5a4e0..80be48d0593db 100644
> --- a/drivers/net/can/sun4i_can.c
> +++ b/drivers/net/can/sun4i_can.c
> @@ -853,7 +853,7 @@ static int sun4ican_probe(struct platform_device *pdev)
>
> irq = platform_get_irq(pdev, 0);
> if (irq < 0) {
> - err = -ENODEV;
> + err = irq;
> goto exit;
> }
[Severity: Medium]
Does returning -EPROBE_DEFER via goto exit leak clk on each deferred probe
attempt?
sun4ican_probe() acquires clk earlier via unmanaged of_clk_get(np, 0), and
the exit label returns err without calling clk_put(clk):
drivers/net/can/sun4i_can.c:sun4ican_probe() {
...
clk = of_clk_get(np, 0);
if (IS_ERR(clk)) {
dev_err(&pdev->dev, "unable to request clock\n");
err = -ENODEV;
goto exit;
}
...
exit_free:
free_candev(dev);
exit:
return err;
}
Also, the commit message quotes this error path as jumping to
exit_put_clk, which does not exist in sun4ican_probe().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261118092955.1283165-1-mkl@pengutronix.de?part=6
next prev parent reply other threads:[~2026-11-19 9:32 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 9:11 [PATCH net-next 0/12] pull-request: can-next 2026-11-18 Marc Kleine-Budde
2026-11-18 9:11 ` [PATCH net-next 01/12] MAINTAINERS: add entry for PEAK-System CAN drivers Marc Kleine-Budde
2026-11-18 9:38 ` netdev-bot+sinfo
2026-11-18 9:45 ` Marc Kleine-Budde
2026-11-18 9:11 ` [PATCH net-next 02/12] can: raw: remove redundant NULL check before netdev_hold() Marc Kleine-Budde
2026-11-18 9:11 ` [PATCH net-next 03/12] can: dev: remove unused safe_candev_priv() Marc Kleine-Budde
2026-11-18 9:11 ` [PATCH net-next 04/12] can: convert to DEFINE_SIMPLE_DEV_PM_OPS() Marc Kleine-Budde
2026-11-19 9:54 ` netdev-bot+sashiko
2026-11-19 11:19 ` Marc Kleine-Budde
2026-11-18 9:11 ` [PATCH net-next 05/12] can: cc770: don't discard the IRQ lookup error in probe Marc Kleine-Budde
2026-11-18 9:11 ` [PATCH net-next 06/12] can: sun4i_can: " Marc Kleine-Budde
2026-11-19 9:32 ` sashiko-bot [this message]
2026-11-19 9:37 ` Marc Kleine-Budde
2026-11-19 9:54 ` netdev-bot+sashiko
2026-11-18 9:11 ` [PATCH net-next 07/12] can: at91_can: " Marc Kleine-Budde
2026-11-19 9:54 ` netdev-bot+sashiko
2026-11-18 9:11 ` [PATCH net-next 08/12] can: janz-ican3: " Marc Kleine-Budde
2026-11-19 9:54 ` netdev-bot+sashiko
2026-11-18 9:11 ` [PATCH net-next 09/12] can: ifi_canfd: " Marc Kleine-Budde
2026-11-19 9:54 ` netdev-bot+sashiko
2026-11-18 9:11 ` [PATCH net-next 10/12] can: remove Softing CANcard driver Marc Kleine-Budde
2026-11-18 9:11 ` [PATCH net-next 11/12] can: ucan: fix repeated word 'is' in comment Marc Kleine-Budde
2026-11-18 9:11 ` [PATCH net-next 12/12] can: xilinx_can: set CAN FD flags on received frames Marc Kleine-Budde
2026-11-19 9:32 ` sashiko-bot
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-222848@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=mailhol@kernel.org \
--cc=mkl@pengutronix.de \
--cc=o.rempel@pengutronix.de \
--cc=sashiko-reviews@lists.linux.dev \
--cc=socketcan@hartkopp.net \
/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