diff options
-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 c62163e272c..f55c4622261 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1379,9 +1379,11 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd, int vnet_hdr_sz; int ret; - if (cmd == TUNSETIFF || _IOC_TYPE(cmd) == 0x89) + if (cmd == TUNSETIFF || _IOC_TYPE(cmd) == 0x89) { if (copy_from_user(&ifr, argp, ifreq_len)) return -EFAULT; + } else + memset(&ifr, 0, sizeof(ifr)); if (cmd == TUNGETFEATURES) { /* Currently this just means: "what IFF flags are valid?". |