]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: Fix warnings from xchg() on RCU'd cookie pointer.
authorDavid S. Miller <davem@davemloft.net>
Sun, 8 Jul 2018 08:02:59 +0000 (17:02 +0900)
committerDavid S. Miller <davem@davemloft.net>
Sun, 8 Jul 2018 08:02:59 +0000 (17:02 +0900)
commit3856089fbc51c7cac1a1094c7773a7159036b826
tree1d96c91f21d0fe00842d48273f5dd2c219a28e78
parent92499b9a82ecb77a9f7685c9e665a06a33a82d1e
net: sched: Fix warnings from xchg() on RCU'd cookie pointer.

The kbuild test robot reports:

>> net/sched/act_api.c:71:15: sparse: incorrect type in initializer (different address spaces) @@    expected struct tc_cookie [noderef] <asn:4>*__ret @@    got [noderef] <asn:4>*__ret @@
   net/sched/act_api.c:71:15:    expected struct tc_cookie [noderef] <asn:4>*__ret
   net/sched/act_api.c:71:15:    got struct tc_cookie *new_cookie
>> net/sched/act_api.c:71:13: sparse: incorrect type in assignment (different address spaces) @@    expected struct tc_cookie *old @@    got struct tc_cookie [noderef] <struct tc_cookie *old @@
   net/sched/act_api.c:71:13:    expected struct tc_cookie *old
   net/sched/act_api.c:71:13:    got struct tc_cookie [noderef] <asn:4>*[assigned] __ret
>> net/sched/act_api.c:132:48: sparse: dereference of noderef expression

Handle this in the usual way by force casting away the __rcu annotation
when we are using xchg() on it.

Fixes: b041aad6e6fc ("net: sched: use rcu for action cookie update")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_api.c