[linux-next:master 7577/7797] net/l2tp/l2tp_core.c:1298:9: sparse: sparse: incorrect type in argument 1 (different address spaces)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   f76698bd9a8ca01d3581236082d786e9a6b72bb7
commit: d18d3f0a24fc4a3513495892ab1a3753628b341b [7577/7797] l2tp: replace hlist with simple list for per-tunnel session list
config: i386-randconfig-062-20240622 (https://download.01.org/0day-ci/archive/20240622/202406220754.evK8Hrjw-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240622/202406220754.evK8Hrjw-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406220754.evK8Hrjw-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> net/l2tp/l2tp_core.c:1298:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct list_head const *list @@     got struct list_head [noderef] __rcu *pos @@
   net/l2tp/l2tp_core.c:1298:9: sparse:     expected struct list_head const *list
   net/l2tp/l2tp_core.c:1298:9: sparse:     got struct list_head [noderef] __rcu *pos
>> net/l2tp/l2tp_core.c:1298:9: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct list_head [noderef] __rcu *pos @@     got struct list_head *next @@
   net/l2tp/l2tp_core.c:1298:9: sparse:     expected struct list_head [noderef] __rcu *pos
   net/l2tp/l2tp_core.c:1298:9: sparse:     got struct list_head *next
>> net/l2tp/l2tp_core.c:1299:27: sparse: sparse: cast removes address space '__rcu' of expression
>> net/l2tp/l2tp_core.c:1298:9: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct list_head [noderef] __rcu *pos @@     got struct list_head *[assigned] tmp @@
   net/l2tp/l2tp_core.c:1298:9: sparse:     expected struct list_head [noderef] __rcu *pos
   net/l2tp/l2tp_core.c:1298:9: sparse:     got struct list_head *[assigned] tmp
   net/l2tp/l2tp_core.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/umh.h, include/linux/kmod.h, ...):
   include/linux/page-flags.h:240:46: sparse: sparse: self-comparison always evaluates to false
   include/linux/page-flags.h:240:46: sparse: sparse: self-comparison always evaluates to false
>> net/l2tp/l2tp_core.c:1298:9: sparse: sparse: dereference of noderef expression
>> net/l2tp/l2tp_core.c:1298:9: sparse: sparse: dereference of noderef expression

vim +1298 net/l2tp/l2tp_core.c

  1287	
  1288	/* When the tunnel is closed, all the attached sessions need to go too.
  1289	 */
  1290	static void l2tp_tunnel_closeall(struct l2tp_tunnel *tunnel)
  1291	{
  1292		struct l2tp_session *session;
  1293		struct list_head __rcu *pos;
  1294		struct list_head *tmp;
  1295	
  1296		spin_lock_bh(&tunnel->list_lock);
  1297		tunnel->acpt_newsess = false;
> 1298		list_for_each_safe(pos, tmp, &tunnel->session_list) {
> 1299			session = list_entry(pos, struct l2tp_session, list);
  1300			list_del_init(&session->list);
  1301			spin_unlock_bh(&tunnel->list_lock);
  1302			l2tp_session_delete(session);
  1303			spin_lock_bh(&tunnel->list_lock);
  1304		}
  1305		spin_unlock_bh(&tunnel->list_lock);
  1306	}
  1307	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux