lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1574409521.12825.0.camel@mtksdaap41>
Date:   Fri, 22 Nov 2019 15:58:41 +0800
From:   CK Hu <ck.hu@...iatek.com>
To:     Pi-Hsun Shih <pihsun@...omium.org>
CC:     Philipp Zabel <p.zabel@...gutronix.de>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Sean Paul <seanpaul@...omium.org>,
        "open list:DRM DRIVERS FOR MEDIATEK" 
        <dri-devel@...ts.freedesktop.org>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-arm-kernel@...ts.infradead.org>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-mediatek@...ts.infradead.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/mediatek: Check return value of
 mtk_drm_ddp_comp_for_plane.

Hi, Pi-Hsun:

On Mon, 2019-11-18 at 14:18 +0800, Pi-Hsun Shih wrote:
> The mtk_drm_ddp_comp_for_plane can return NULL, but the usage doesn't
> check for it. Add check for it.

Reviewed-by: CK Hu <ck.hu@...iatek.com>

> 
> Fixes: d6b53f68356f ("drm/mediatek: Add helper to get component for a plane")
> Signed-off-by: Pi-Hsun Shih <pihsun@...omium.org>
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> index f80a8ba75977..4c4f976c994e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> @@ -310,7 +310,9 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc)
>  
>  		plane_state = to_mtk_plane_state(plane->state);
>  		comp = mtk_drm_ddp_comp_for_plane(crtc, plane, &local_layer);
> -		mtk_ddp_comp_layer_config(comp, local_layer, plane_state);
> +		if (comp)
> +			mtk_ddp_comp_layer_config(comp, local_layer,
> +						  plane_state);
>  	}
>  
>  	return 0;
> @@ -386,8 +388,9 @@ static void mtk_crtc_ddp_config(struct drm_crtc *crtc)
>  			comp = mtk_drm_ddp_comp_for_plane(crtc, plane,
>  							  &local_layer);
>  
> -			mtk_ddp_comp_layer_config(comp, local_layer,
> -						  plane_state);
> +			if (comp)
> +				mtk_ddp_comp_layer_config(comp, local_layer,
> +							  plane_state);
>  			plane_state->pending.config = false;
>  		}
>  		mtk_crtc->pending_planes = false;
> @@ -401,7 +404,9 @@ int mtk_drm_crtc_plane_check(struct drm_crtc *crtc, struct drm_plane *plane,
>  	struct mtk_ddp_comp *comp;
>  
>  	comp = mtk_drm_ddp_comp_for_plane(crtc, plane, &local_layer);
> -	return mtk_ddp_comp_layer_check(comp, local_layer, state);
> +	if (comp)
> +		return mtk_ddp_comp_layer_check(comp, local_layer, state);
> +	return 0;
>  }
>  
>  static void mtk_drm_crtc_atomic_enable(struct drm_crtc *crtc,
> 
> base-commit: 5a6fcbeabe3e20459ed8504690b2515dacc5246f

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ