mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [mingo-tip:sched/headers 400/2574] net/ipv4/nexthop.c:3686:32: sparse: sparse: dereference of noderef expression
Date: Mon, 21 Feb 2022 17:51:58 +0800	[thread overview]
Message-ID: <202202211705.vXSB551U-lkp@intel.com> (raw)

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git sched/headers
head:   39e8a0edc8fae20758051dadf7846849edc18b88
commit: 1458e29daa7f391e80f5d3f837586c6df551c740 [400/2574] headers/uninline: Uninline multi-use function: rb_link_node() and rb_link_node_rcu()
config: x86_64-randconfig-s022-20220221 (https://download.01.org/0day-ci/archive/20220221/202202211705.vXSB551U-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git/commit/?id=1458e29daa7f391e80f5d3f837586c6df551c740
        git remote add mingo-tip git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git
        git fetch --no-tags mingo-tip sched/headers
        git checkout 1458e29daa7f391e80f5d3f837586c6df551c740
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/entry/vsyscall/ drivers/hwspinlock/ net/ipv4/

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


sparse warnings: (new ones prefixed by >>)
>> net/ipv4/nexthop.c:3686:32: sparse: sparse: dereference of noderef expression

vim +3686 net/ipv4/nexthop.c

e95f2592f633a3 Ido Schimmel 2020-11-04  3667  
56ad5ba344dea9 Ido Schimmel 2021-03-11  3668  void nexthop_bucket_set_hw_flags(struct net *net, u32 id, u16 bucket_index,
56ad5ba344dea9 Ido Schimmel 2021-03-11  3669  				 bool offload, bool trap)
56ad5ba344dea9 Ido Schimmel 2021-03-11  3670  {
56ad5ba344dea9 Ido Schimmel 2021-03-11  3671  	struct nh_res_table *res_table;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3672  	struct nh_res_bucket *bucket;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3673  	struct nexthop *nexthop;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3674  	struct nh_group *nhg;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3675  
56ad5ba344dea9 Ido Schimmel 2021-03-11  3676  	rcu_read_lock();
56ad5ba344dea9 Ido Schimmel 2021-03-11  3677  
56ad5ba344dea9 Ido Schimmel 2021-03-11  3678  	nexthop = nexthop_find_by_id(net, id);
56ad5ba344dea9 Ido Schimmel 2021-03-11  3679  	if (!nexthop || !nexthop->is_group)
56ad5ba344dea9 Ido Schimmel 2021-03-11  3680  		goto out;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3681  
56ad5ba344dea9 Ido Schimmel 2021-03-11  3682  	nhg = rcu_dereference(nexthop->nh_grp);
56ad5ba344dea9 Ido Schimmel 2021-03-11  3683  	if (!nhg->resilient)
56ad5ba344dea9 Ido Schimmel 2021-03-11  3684  		goto out;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3685  
56ad5ba344dea9 Ido Schimmel 2021-03-11 @3686  	if (bucket_index >= nhg->res_table->num_nh_buckets)
56ad5ba344dea9 Ido Schimmel 2021-03-11  3687  		goto out;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3688  
56ad5ba344dea9 Ido Schimmel 2021-03-11  3689  	res_table = rcu_dereference(nhg->res_table);
56ad5ba344dea9 Ido Schimmel 2021-03-11  3690  	bucket = &res_table->nh_buckets[bucket_index];
56ad5ba344dea9 Ido Schimmel 2021-03-11  3691  	bucket->nh_flags &= ~(RTNH_F_OFFLOAD | RTNH_F_TRAP);
56ad5ba344dea9 Ido Schimmel 2021-03-11  3692  	if (offload)
56ad5ba344dea9 Ido Schimmel 2021-03-11  3693  		bucket->nh_flags |= RTNH_F_OFFLOAD;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3694  	if (trap)
56ad5ba344dea9 Ido Schimmel 2021-03-11  3695  		bucket->nh_flags |= RTNH_F_TRAP;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3696  
56ad5ba344dea9 Ido Schimmel 2021-03-11  3697  out:
56ad5ba344dea9 Ido Schimmel 2021-03-11  3698  	rcu_read_unlock();
56ad5ba344dea9 Ido Schimmel 2021-03-11  3699  }
56ad5ba344dea9 Ido Schimmel 2021-03-11  3700  EXPORT_SYMBOL(nexthop_bucket_set_hw_flags);
56ad5ba344dea9 Ido Schimmel 2021-03-11  3701  

:::::: The code at line 3686 was first introduced by commit
:::::: 56ad5ba344dea9c914331da8754f5ba7cede9941 nexthop: Allow setting "offload" and "trap" indication of nexthop buckets

:::::: TO: Ido Schimmel <idosch@nvidia.com>
:::::: CC: David S. Miller <davem@davemloft.net>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

                 reply	other threads:[~2022-02-21 10:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202202211705.vXSB551U-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®