Re: [PATCH] bus: imx-weim: fix to avoid potential NULL pointer dereference

From: Fabio Estevam
Date: Mon Aug 28 2023 - 14:42:37 EST


Hi Shurong,

On Mon, Aug 28, 2023 at 12:03 PM Zhang Shurong
<zhang_shurong@xxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxxxxxxx/T/#t

Please do not introduce these checks.