Skip to contentSkip to conversation

drm/stm: ltdc: add clut mode support

bug report Dan Carpenter 2 participants 2 messages Feb 22, 2018 – Apr 10, 2018

lore
Share & tools
lore
#0 lore raw

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
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

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 :-)

Quoted 22 lines · Dan Carpenter

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)
                      ^^^^
Quoted 8 lines

Too late.

    396			return;
    397	

regards,
dan carpenter

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel