All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 3459/4317] drivers/gpu/drm/vc4/vc4_perfmon.c:25 vc4_perfmon_get() warn: variable dereferenced before check 'perfmon' (see line 20)
@ 2022-06-20  8:26 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-06-19  4:12 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2358 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Maxime Ripard <maxime@cerno.tech>
CC: Melissa Wen <mwen@igalia.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   07dc787be2316e243a16a33d0a9b734cd9365bd3
commit: 30f8c74ca9b7b3a2db55f6bb1d2e9f8c47a79f94 [3459/4317] drm/vc4: Warn if some v3d code is run on BCM2711
:::::: branch date: 2 days ago
:::::: commit date: 3 days ago
config: parisc-randconfig-m031-20220619 (https://download.01.org/0day-ci/archive/20220619/202206191217.pbL9f0PA-lkp(a)intel.com/config)
compiler: hppa-linux-gcc (GCC) 11.3.0

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

smatch warnings:
drivers/gpu/drm/vc4/vc4_perfmon.c:25 vc4_perfmon_get() warn: variable dereferenced before check 'perfmon' (see line 20)
drivers/gpu/drm/vc4/vc4_perfmon.c:240 vc4_perfmon_get_values_ioctl() warn: variable dereferenced before check 'perfmon' (see line 237)
drivers/gpu/drm/vc4/vc4_validate.c:173 vc4_check_tex_size() warn: signedness bug returning '(-19)'

vim +/perfmon +25 drivers/gpu/drm/vc4/vc4_perfmon.c

65101d8c910820 Boris Brezillon 2018-01-12  17  
65101d8c910820 Boris Brezillon 2018-01-12  18  void vc4_perfmon_get(struct vc4_perfmon *perfmon)
65101d8c910820 Boris Brezillon 2018-01-12  19  {
30f8c74ca9b7b3 Maxime Ripard   2022-06-10 @20  	struct vc4_dev *vc4 = perfmon->dev;
30f8c74ca9b7b3 Maxime Ripard   2022-06-10  21  
30f8c74ca9b7b3 Maxime Ripard   2022-06-10  22  	if (WARN_ON_ONCE(vc4->is_vc5))
30f8c74ca9b7b3 Maxime Ripard   2022-06-10  23  		return;
30f8c74ca9b7b3 Maxime Ripard   2022-06-10  24  
65101d8c910820 Boris Brezillon 2018-01-12 @25  	if (perfmon)
65101d8c910820 Boris Brezillon 2018-01-12  26  		refcount_inc(&perfmon->refcnt);
65101d8c910820 Boris Brezillon 2018-01-12  27  }
65101d8c910820 Boris Brezillon 2018-01-12  28  

:::::: The code at line 25 was first introduced by commit
:::::: 65101d8c9108201118efa7e08f4e2c57f438deb9 drm/vc4: Expose performance counters to userspace

:::::: TO: Boris Brezillon <boris.brezillon@free-electrons.com>
:::::: CC: Eric Anholt <eric@anholt.net>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [linux-next:master 3459/4317] drivers/gpu/drm/vc4/vc4_perfmon.c:25 vc4_perfmon_get() warn: variable dereferenced before check 'perfmon' (see line 20)
@ 2022-06-20  8:26 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2022-06-20  8:26 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2008 bytes --]

[ The -mm tree somehow confuses kbuild.  Not sure what's going on with
  that. ]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   07dc787be2316e243a16a33d0a9b734cd9365bd3
commit: 30f8c74ca9b7b3a2db55f6bb1d2e9f8c47a79f94 [3459/4317] drm/vc4: Warn if some v3d code is run on BCM2711
config: parisc-randconfig-m031-20220619 (https://download.01.org/0day-ci/archive/20220619/202206191217.pbL9f0PA-lkp(a)intel.com/config)
compiler: hppa-linux-gcc (GCC) 11.3.0

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

smatch warnings:
drivers/gpu/drm/vc4/vc4_perfmon.c:25 vc4_perfmon_get() warn: variable dereferenced before check 'perfmon' (see line 20)
drivers/gpu/drm/vc4/vc4_perfmon.c:240 vc4_perfmon_get_values_ioctl() warn: variable dereferenced before check 'perfmon' (see line 237)
drivers/gpu/drm/vc4/vc4_validate.c:173 vc4_check_tex_size() warn: signedness bug returning '(-19)'

vim +/perfmon +25 drivers/gpu/drm/vc4/vc4_perfmon.c

65101d8c910820 Boris Brezillon 2018-01-12  18  void vc4_perfmon_get(struct vc4_perfmon *perfmon)
65101d8c910820 Boris Brezillon 2018-01-12  19  {
30f8c74ca9b7b3 Maxime Ripard   2022-06-10 @20  	struct vc4_dev *vc4 = perfmon->dev;
                                                                      ^^^^^^^^^^^^
Derefence

30f8c74ca9b7b3 Maxime Ripard   2022-06-10  21  
30f8c74ca9b7b3 Maxime Ripard   2022-06-10  22  	if (WARN_ON_ONCE(vc4->is_vc5))
30f8c74ca9b7b3 Maxime Ripard   2022-06-10  23  		return;
30f8c74ca9b7b3 Maxime Ripard   2022-06-10  24  
65101d8c910820 Boris Brezillon 2018-01-12 @25  	if (perfmon)
                                                    ^^^^^^^
Checked too late

65101d8c910820 Boris Brezillon 2018-01-12  26  		refcount_inc(&perfmon->refcnt);
65101d8c910820 Boris Brezillon 2018-01-12  27  }

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-20  8:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-19  4:12 [linux-next:master 3459/4317] drivers/gpu/drm/vc4/vc4_perfmon.c:25 vc4_perfmon_get() warn: variable dereferenced before check 'perfmon' (see line 20) kernel test robot
2022-06-20  8:26 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.