mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
f9e06c45cb
commit
6f0271d929
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue