[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200612121321.GG4282@kadam>
Date: Fri, 12 Jun 2020 15:13:21 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: kbuild@...ts.01.org, Grygorii Strashko <grygorii.strashko@...com>
Cc: lkp@...el.com, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org,
Santosh Shilimkar <santosh.shilimkar@...cle.com>,
Peter Ujfalusi <peter.ujfalusi@...com>,
Tero Kristo <t-kristo@...com>
Subject: [kbuild] drivers/soc/ti/k3-ringacc.c:562 k3_ringacc_ring_cfg() warn:
variable dereferenced before check 'ring' (see line 559)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b791d1bdf9212d944d749a5c7ff6febdba241771
commit: 3277e8aa2504d97e022ecb9777d784ac1a439d36 soc: ti: k3: add navss ringacc driver
config: arm64-randconfig-m031-20200612 (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@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
smatch warnings:
drivers/soc/ti/k3-ringacc.c:562 k3_ringacc_ring_cfg() warn: variable dereferenced before check 'ring' (see line 559)
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3277e8aa2504d97e022ecb9777d784ac1a439d36
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout 3277e8aa2504d97e022ecb9777d784ac1a439d36
vim +/ring +562 drivers/soc/ti/k3-ringacc.c
3277e8aa2504d97 Grygorii Strashko 2020-01-15 557 int k3_ringacc_ring_cfg(struct k3_ring *ring, struct k3_ring_cfg *cfg)
3277e8aa2504d97 Grygorii Strashko 2020-01-15 558 {
3277e8aa2504d97 Grygorii Strashko 2020-01-15 @559 struct k3_ringacc *ringacc = ring->parent;
^^^^^^^^^^^^
Dereference.
3277e8aa2504d97 Grygorii Strashko 2020-01-15 560 int ret = 0;
3277e8aa2504d97 Grygorii Strashko 2020-01-15 561
3277e8aa2504d97 Grygorii Strashko 2020-01-15 @562 if (!ring || !cfg)
^^^^
Check too late. Delete it?
3277e8aa2504d97 Grygorii Strashko 2020-01-15 563 return -EINVAL;
3277e8aa2504d97 Grygorii Strashko 2020-01-15 564 if (cfg->elm_size > K3_RINGACC_RING_ELSIZE_256 ||
3277e8aa2504d97 Grygorii Strashko 2020-01-15 565 cfg->mode >= K3_RINGACC_RING_MODE_INVALID ||
3277e8aa2504d97 Grygorii Strashko 2020-01-15 566 cfg->size & ~K3_RINGACC_CFG_RING_SIZE_ELCNT_MASK ||
3277e8aa2504d97 Grygorii Strashko 2020-01-15 567 !test_bit(ring->ring_id, ringacc->rings_inuse))
3277e8aa2504d97 Grygorii Strashko 2020-01-15 568 return -EINVAL;
3277e8aa2504d97 Grygorii Strashko 2020-01-15 569
3277e8aa2504d97 Grygorii Strashko 2020-01-15 570 if (cfg->mode == K3_RINGACC_RING_MODE_MESSAGE &&
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (33292 bytes)
_______________________________________________
kbuild mailing list -- kbuild@...ts.01.org
To unsubscribe send an email to kbuild-leave@...ts.01.org
Powered by blists - more mailing lists