Linux CAN drivers development
 help / color / mirror / Atom feed
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>,
	wsa+renesas@sang-engineering.com
Subject: Re: [PATCH can 1/4] can: c_can: c_can_plat_probe(): reject devices without match data
Date: Sat, 14 Nov 2026 13:33:34 +0000	[thread overview]
Message-ID: <sashiko-outbox-214574@kernel.org> (raw)
In-Reply-To: <20261114-fix-device_get_match_data-v1-1-2d82025e9646@pengutronix.de>

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?

device_get_match_data() only queries dev_fwnode(dev) and never inspects
struct platform_driver.id_table.  Because c_can_plat_driver registers
.id_table = c_can_id_table with .driver_data pointers, devices matched
through c_can_id_table get NULL from device_get_match_data() and fail
probe with -ENODEV unless platform_get_device_id(pdev) is checked as a
fallback (as done prior to 5e6c3454b405 ("net: can: Use
device_get_match_data()")).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261114-fix-device_get_match_data-v1-0-2d82025e9646@pengutronix.de?part=1

  reply	other threads:[~2026-11-14 13:33 UTC|newest]

Thread overview: 9+ 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 [this message]
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-14 12:56 ` [PATCH can 3/4] can: xilinx_can: xcan_probe(): " Marc Kleine-Budde
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

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-214574@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 \
    --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