Re: [PATCH] drm/bridge:Fix the panic problem caused by bridge->funcs->attach

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 17, 2023 at 12:52 PM logic.yu <hymmsx.yu@xxxxxxxxx> wrote:
>
> When the code is executed to bridge->funcs->attach,bridge->funcs is NULL.
> Although the function entry checks whether the bridge pointer is NULL,it
> does not detect whether the bridge->funcs is NULL, so a panic error
> occurs.
>
> Signed-off-by: logic.yu <hymmsx.yu@xxxxxxxxx>
> ---
>  drivers/gpu/drm/drm_bridge.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
> index c3d69af02e79..f3dd67fb3f1d 100644
> --- a/drivers/gpu/drm/drm_bridge.c
> +++ b/drivers/gpu/drm/drm_bridge.c
> @@ -302,7 +302,7 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge,
>  {
>         int ret;
>
> -       if (!encoder || !bridge)
> +       if (!encoder || !bridge || !bridge->funcs)

Would you please share the use case log where you found panic? I think
checking bridge->funcs during funcs-> trigger later in this function
would be a valid check (assume if an issue) as some drivers use the
bridge to handle downstream bridge w/o using any bridge functions.

Jagan.




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux