Hi Marek,

url:    
https://github.com/intel-lab-lkp/linux/commits/Marek-Vasut/drm-mxsfb-Implement-LCDIF-scanout-CRC32-support/20220410-071222
base:   git://anongit.freedesktop.org/drm/drm drm-next
config: i386-randconfig-m021-20220411 
(https://download.01.org/0day-ci/archive/20220411/[email protected]/config)
compiler: gcc-11 (Debian 11.2.0-19) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
drivers/gpu/drm/mxsfb/mxsfb_kms.c:444 mxsfb_crtc_set_crc_source() warn: 
variable dereferenced before check 'crtc' (see line 442)

vim +/crtc +444 drivers/gpu/drm/mxsfb/mxsfb_kms.c

5797982b2ba894 Marek Vasut      2022-04-10  440  static int 
mxsfb_crtc_set_crc_source(struct drm_crtc *crtc, const char *source)
5797982b2ba894 Marek Vasut      2022-04-10  441  {
5797982b2ba894 Marek Vasut      2022-04-10 @442         struct 
mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->dev);
                                                                                
                               ^^^^^^^^^
Dereference

5797982b2ba894 Marek Vasut      2022-04-10  443  
5797982b2ba894 Marek Vasut      2022-04-10 @444         if (!crtc)
                                                            ^^^^^
Checked too late


5797982b2ba894 Marek Vasut      2022-04-10  445                 return -ENODEV;
5797982b2ba894 Marek Vasut      2022-04-10  446  
5797982b2ba894 Marek Vasut      2022-04-10  447         if (source && 
strcmp(source, "auto") == 0)
5797982b2ba894 Marek Vasut      2022-04-10  448                 
mxsfb->crc_active = true;
5797982b2ba894 Marek Vasut      2022-04-10  449         else if (!source)
5797982b2ba894 Marek Vasut      2022-04-10  450                 
mxsfb->crc_active = false;
5797982b2ba894 Marek Vasut      2022-04-10  451         else
5797982b2ba894 Marek Vasut      2022-04-10  452                 return -EINVAL;
5797982b2ba894 Marek Vasut      2022-04-10  453  
5797982b2ba894 Marek Vasut      2022-04-10  454         return 0;
5797982b2ba894 Marek Vasut      2022-04-10  455  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Reply via email to