From: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
To: sashiko-reviews@lists.linux.dev
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
linux-can@vger.kernel.org,
Oliver Hartkopp <socketcan@hartkopp.net>,
Vincent Mailhol <mailhol@kernel.org>,
Oleksij Rempel <o.rempel@pengutronix.de>,
wsa+renesas@sang-engineering.com
Subject: Re: [PATCH can 1/4] can: c_can: c_can_plat_probe(): reject devices without match data
Date: Mon, 16 Nov 2026 10:23:02 +0100 [thread overview]
Message-ID: <avrJ54bCPy5K1QcJ@monoceros> (raw)
In-Reply-To: <sashiko-outbox-214574@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1611 bytes --]
On Sat, Nov 14, 2026 at 01:33:34PM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue to consider:
> - [Medium] can: c_can: c_can_plat_probe() rejects c_can_id_table matches
> with -ENODEV
> --
>
> commit e910ae3e03adb41c30f60d29d9b4c11824109fe5
> Author: Marc Kleine-Budde <mkl@pengutronix.de>
>
> can: c_can: c_can_plat_probe(): reject devices without match data
>
> This commit rejects devices in c_can_plat_probe() when
> device_get_match_data() returns NULL.
>
> > diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
> > index 75607b1afd2e9..b6012cd713cee 100644
> > --- a/drivers/net/can/c_can/c_can_platform.c
> > +++ b/drivers/net/can/c_can/c_can_platform.c
> > @@ -266,6 +266,8 @@ static int c_can_plat_probe(struct platform_device *pdev)
> > struct device_node *np = pdev->dev.of_node;
> >
> > drvdata = device_get_match_data(&pdev->dev);
> > + if (!drvdata)
> > + return -ENODEV;
>
> [Severity: Medium]
> Does this reject non-fwnode platform devices matched via c_can_id_table?
It does, however there are none of these since commit 17b6e0280f31
("ARM: OMAP2+: Drop legacy platform data for am3 and am4 dcan") from
2019. So a useful followup cleanup is to drop c_can_id_table[].
For now I suggest to mention that in the commit log. (Though if there
was such a device, the patch would make the probe function return
-ENODEV instead of dying with a null-pointer exception, so it doesn't
break anything that worked before.)
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2026-11-16 9:23 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 12:56 [PATCH can 0/4] can: fix probing and use of device_get_match_data() Marc Kleine-Budde
2026-11-14 12:56 ` [PATCH can 1/4] can: c_can: c_can_plat_probe(): reject devices without match data Marc Kleine-Budde
2026-11-14 13:33 ` sashiko-bot
2026-11-16 9:23 ` Uwe Kleine-König [this message]
2026-11-16 9:33 ` Marc Kleine-Budde
2026-11-14 12:56 ` [PATCH can 2/4] can: flexcan: flexcan_probe(): fix probing for m68k/coldfire and " Marc Kleine-Budde
2026-11-14 13:03 ` sashiko-bot
2026-11-16 9:14 ` Uwe Kleine-König
2026-11-16 9:32 ` Marc Kleine-Budde
2026-11-14 12:56 ` [PATCH can 3/4] can: xilinx_can: xcan_probe(): " Marc Kleine-Budde
2026-11-16 6:48 ` Michal Simek
2026-11-14 12:56 ` [PATCH can 4/4] can: rcar_canfd: rcar_canfd_probe(): " Marc Kleine-Budde
2026-11-14 13:03 ` sashiko-bot
2026-11-14 13:09 ` Marc Kleine-Budde
2026-11-16 8:39 ` Biju Das
2026-11-16 8:54 ` Marc Kleine-Budde
2026-11-16 9:12 ` Biju Das
2026-11-16 9:20 ` Marc Kleine-Budde
2026-11-16 9:27 ` Biju Das
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=avrJ54bCPy5K1QcJ@monoceros \
--to=u.kleine-koenig@baylibre.com \
--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 \
--cc=wsa+renesas@sang-engineering.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;
as well as URLs for NNTP newsgroup(s).