diff options
author | David S. Miller <davem@davemloft.net> | 2018-11-17 16:53:46 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-17 16:53:46 -0800 |
commit | 6f0271d92963bc8588ad7058622ec7b1e94852de (patch) | |
tree | 6da9106579a3209ce868af5d0b653383465876c0 /drivers/net/tun.c | |
parent | f9e06c45cb28beb30a6a474952ead7da2b8940f3 (diff) | |
download | linux-6f0271d92963bc8588ad7058622ec7b1e94852de.tar.gz linux-6f0271d92963bc8588ad7058622ec7b1e94852de.tar.bz2 linux-6f0271d92963bc8588ad7058622ec7b1e94852de.zip |
tun: Adjust on-stack tun_page initialization.
Instead of constantly playing with the struct initializer
syntax trying to make gcc and CLang both happy, just clear
it out using memset().
>> drivers/net/tun.c:2503:42: warning: Using plain integer as NULL pointer
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r-- | drivers/net/tun.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index e90a7923a5f6..36163a147d39 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -2500,10 +2500,12 @@ static int tun_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len) return -EBADFD; if (ctl && (ctl->type == TUN_MSG_PTR)) { - struct tun_page tpage = {0}; + struct tun_page tpage; int n = ctl->num; int flush = 0; + memset(&tpage, 0, sizeof(tpage)); + local_bh_disable(); rcu_read_lock(); |