aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tun.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-11-17 16:53:46 -0800
committerDavid S. Miller <davem@davemloft.net>2018-11-17 16:53:46 -0800
commit6f0271d92963bc8588ad7058622ec7b1e94852de (patch)
tree6da9106579a3209ce868af5d0b653383465876c0 /drivers/net/tun.c
parenttuntap: free XDP dropped packets in a batch (diff)
downloadlinux-dev-6f0271d92963bc8588ad7058622ec7b1e94852de.tar.xz
linux-dev-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.c4
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();