lkml.org 
[lkml]   [2021]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectdrivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c:31 dpu_setup_dspp_pcc() warn: variable dereferenced before check 'ctx' (see line 29)
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fe07bfda2fb9cdef8a4d4008a409bb02f35f1bd8
commit: 4259ff7ae509ed880b3a7bb685972c3a3bf4b74b drm/msm/dpu: add support for pcc color block in dpu driver
config: arm64-randconfig-m031-20210301 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c:31 dpu_setup_dspp_pcc() warn: variable dereferenced before check 'ctx' (see line 29)

vim +/ctx +31 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c

4259ff7ae509ed Kalyan Thota 2020-03-24 28
4259ff7ae509ed Kalyan Thota 2020-03-24 @29 u32 base = ctx->cap->sblk->pcc.base;
^^^^^
Dereference

4259ff7ae509ed Kalyan Thota 2020-03-24 30
4259ff7ae509ed Kalyan Thota 2020-03-24 @31 if (!ctx || !base) {
^^^^
Checked too late

4259ff7ae509ed Kalyan Thota 2020-03-24 32 DRM_ERROR("invalid ctx %pK pcc base 0x%x\n", ctx, base);
4259ff7ae509ed Kalyan Thota 2020-03-24 33 return;
4259ff7ae509ed Kalyan Thota 2020-03-24 34 }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2021-03-01 08:02    [W:0.049 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site