[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAOMZO5Cxg_x7iO01kDFNH=ENMU3ey4dLsYnLo-1Vf_oP+QNFSg@mail.gmail.com>
Date: Mon, 28 Aug 2023 15:41:28 -0300
From: Fabio Estevam <festevam@...il.com>
To: Zhang Shurong <zhang_shurong@...mail.com>
Cc: shawnguo@...nel.org, s.hauer@...gutronix.de, kernel@...gutronix.de,
linux-imx@....com, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] bus: imx-weim: fix to avoid potential NULL pointer dereference
Hi Shurong,
On Mon, Aug 28, 2023 at 12:03 PM Zhang Shurong
<zhang_shurong@...mail.com> wrote:
> Hello Fabio,
>
> I think we can make it happen by designing the platform device in a way that
> its name aligns with that of the driver. In such a scenario, when the driver
> is probed, the of_match_device function will return null. You can verify this
> functionality by reviewing the following function:
>
> static int platform_match(struct device *dev, struct device_driver *drv)
This cannot happen in practice as explained by Laurent in your other patch:
https://lore.kernel.org/dri-devel/20230828183748.GK14596@pendragon.ideasonboard.com/T/#t
Please do not introduce these checks.
Powered by blists - more mailing lists