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

Dan Carpenter dan.carpenter at oracle.com
Thu Feb 22 19:27:19 UTC 2018


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