[bug report] drm/stm: ltdc: add clut mode support

Philippe CORNU philippe.cornu at st.com
Tue Apr 10 15:20:21 UTC 2018


Hi Dan,
and many thanks for the bug report.
I sent a patch to fix this issue
https://patchwork.freedesktop.org/patch/216180/
Thank you,
Philippe :-)


On 02/22/2018 08:27 PM, Dan Carpenter wrote:
> Hello Philippe CORNU,
> 
> This is a semi-automatic email about new static checker warnings.
> 
> The patch b706a25eaed0: "drm/stm: ltdc: add clut mode support" from
> Oct 26, 2017, leads to the following Smatch complaint:
> 
>      drivers/gpu/drm/stm/ltdc.c:395 ltdc_crtc_update_clut()
>      warn: variable dereferenced before check 'crtc' (see line 390)
> 
> drivers/gpu/drm/stm/ltdc.c
>     389	{
>     390		struct ltdc_device *ldev = crtc_to_ltdc(crtc);
>                                                          ^^^^
> Dereferenced inside the function call
> 
>     391		struct drm_color_lut *lut;
>     392		u32 val;
>     393		int i;
>     394	
>     395		if (!crtc || !crtc->state)
>                       ^^^^
> Too late.
> 
>     396			return;
>     397	
> 
> regards,
> dan carpenter
> 


More information about the dri-devel mailing list