mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <ukleinek@kernel.org>
To: Marc Kleine-Budde <mkl@pengutronix.de>,
	 Biju Das <biju.das.jz@bp.renesas.com>
Cc: Vincent Mailhol <mailhol@kernel.org>,
	Rob Herring <robh@kernel.org>,  Harini T <harini.t@amd.com>,
	Michal Simek <michal.simek@amd.com>,
	 Geert Uytterhoeven <geert+renesas@glider.be>,
	"magnus.damm" <magnus.damm@gmail.com>,
	 "kernel@pengutronix.de" <kernel@pengutronix.de>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	 "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	 "linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH can 4/4] can: rcar_canfd: rcar_canfd_probe(): reject devices without match data
Date: Mon, 16 Nov 2026 12:24:50 +0100	[thread overview]
Message-ID: <avrnzDmTgdpK9jQQ@monoceros> (raw)
In-Reply-To: <20261116-cream-hornet-from-lemuria-703c6b-mkl@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 2128 bytes --]

On Mon, Nov 16, 2026 at 09:54:58AM +0100, Marc Kleine-Budde wrote:
> On 16.11.2026 08:39:36, Biju Das wrote:
> > Hi Marc,
> >
> > > -----Original Message-----
> > > From: linux-arm-kernel <linux-arm-kernel-bounces@lists.infradead.org> On Behalf Of Marc Kleine-Budde
> > > Sent: 14 November 2026 12:56
> > > Subject: [PATCH can 4/4] can: rcar_canfd: rcar_canfd_probe(): reject devices without match data
> > >
> > > A device bound through driver_override need not match an entry in of_match_table. In that case
> > > device_get_match_data() returns NULL, but
> > > rcar_canfd_probe() dereferences the result.
> > >
> > > Reject devices without match data before continuing probe.
> > >
> > > Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> > > ---
> > >  drivers/net/can/rcar/rcar_canfd.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> > > diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
> > > index 000a6433f46d..9d463a9c1766 100644
> > > --- a/drivers/net/can/rcar/rcar_canfd.c
> > > +++ b/drivers/net/can/rcar/rcar_canfd.c
> > > @@ -2113,6 +2113,8 @@ static int rcar_canfd_probe(struct platform_device *pdev)
> > >  	int i;
> > >
> > >  	info = of_device_get_match_data(dev);
> > > +	if (!info)
> > > +		return -ENODEV;
> >
> >
> > There is a patch on the fly to disable driver_override by default [1].
> > In that case if we plan to use driver_override, probe will return failure.
> > I may be wrong. Please correct me if Iam wrong
> >
> > [1] https://lore.kernel.org/all/0f7446324f6a0c8f0153d6532d92a6eeecd6a308.1790612298.git.u.kleine-koenig@baylibre.com/
> 
> Thanks, I wasn't aware of this series. I tested the driver_override on
> the flexcan driver with latest net/main, fixed it, and applied the fix
> to all affected CAN drivers.
> 
> Should I drop the driver_override related null pointer checks from this
> series?

IMHO yes.

I just sent out a new revision of the change, find it at
https://lore.kernel.org/all/20261116110853.3418077-2-u.kleine-koenig@baylibre.com/
as I failed to add you Cc.

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      parent reply	other threads:[~2026-11-16 11:24 UTC|newest]

Thread overview: 14+ 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 12:56 ` [PATCH can 2/4] can: flexcan: flexcan_probe(): fix probing for m68k/coldfire and " Marc Kleine-Budde
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-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
2026-11-16 11:24       ` Uwe Kleine-König [this message]

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=avrnzDmTgdpK9jQQ@monoceros \
    --to=ukleinek@kernel.org \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=harini.t@amd.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=mailhol@kernel.org \
    --cc=michal.simek@amd.com \
    --cc=mkl@pengutronix.de \
    --cc=robh@kernel.org \
    /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

all inboxes | Powered by JetHome®