lkml.org 
[lkml]   [2018]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH] drm/stm: ltdc: fix warning in ltdc_crtc_update_clut()
Date
Reviewed-by: yannick fertre <yannick.fertre@st.com>


On 04/10/2018 03:53 PM, Philippe Cornu wrote:
> Fix the warning
> "warn: variable dereferenced before check 'crtc' (see line 390)"
> by removing unnecessary checks as ltdc_crtc_update_clut() is
> only called from ltdc_crtc_atomic_flush() where crtc and
> crtc->state are not NULL.
>
> Many thanks to Dan Carpenter for the bug report
> https://lists.freedesktop.org/archives/dri-devel/2018-February/166918.html
>
> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/gpu/drm/stm/ltdc.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index 061d2b6e5157..e3121d9e4230 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -392,9 +392,6 @@ static void ltdc_crtc_update_clut(struct drm_crtc *crtc)
> u32 val;
> int i;
>
> - if (!crtc || !crtc->state)
> - return;
> -
> if (!crtc->state->color_mgmt_changed || !crtc->state->gamma_lut)
> return;
>
\
 
 \ /
  Last update: 2018-04-16 11:19    [W:0.021 / U:6.660 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site