diff options
author | Jason Wang <jasowang@redhat.com> | 2020-07-31 07:17:20 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-08-01 03:17:53 +0300 |
commit | 8f3f330da28ede9d106cd9d5c5ccd6a3e7e9b50b (patch) | |
tree | 9e6cb04d277a46ffcec1c5769fe33f759023fb69 /drivers | |
parent | 48040793fa6003d211f021c6ad273477bcd90d91 (diff) | |
download | linux-8f3f330da28ede9d106cd9d5c5ccd6a3e7e9b50b.tar.xz |
tun: add missing rcu annotation in tun_set_ebpf()
We expecte prog_p to be protected by rcu, so adding the rcu annotation
to fix the following sparse warning:
drivers/net/tun.c:3003:36: warning: incorrect type in argument 2 (different address spaces)
drivers/net/tun.c:3003:36: expected struct tun_prog [noderef] __rcu **prog_p
drivers/net/tun.c:3003:36: got struct tun_prog **prog_p
drivers/net/tun.c:3292:42: warning: incorrect type in argument 2 (different address spaces)
drivers/net/tun.c:3292:42: expected struct tun_prog **prog_p
drivers/net/tun.c:3292:42: got struct tun_prog [noderef] __rcu **
drivers/net/tun.c:3296:42: warning: incorrect type in argument 2 (different address spaces)
drivers/net/tun.c:3296:42: expected struct tun_prog **prog_p
drivers/net/tun.c:3296:42: got struct tun_prog [noderef] __rcu **
Reported-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/tun.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 7adeb91bd368..9b4b25358f9b 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -2983,7 +2983,7 @@ unlock: return ret; } -static int tun_set_ebpf(struct tun_struct *tun, struct tun_prog **prog_p, +static int tun_set_ebpf(struct tun_struct *tun, struct tun_prog __rcu **prog_p, void __user *data) { struct bpf_prog *prog; |