[PATCH] bus: imx-weim: fix to avoid potential NULL pointer dereference
Fabio Estevam
festevam at gmail.com
Mon Aug 28 11:41:28 PDT 2023
Hi Shurong,
On Mon, Aug 28, 2023 at 12:03 PM Zhang Shurong
<zhang_shurong at foxmail.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.
More information about the linux-arm-kernel
mailing list