OSDN Git Service

can: c_can: Add support for TI am3352 DCAN
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / drivers / net / tun.c
index 2ff769b..e3fa65a 100644 (file)
@@ -1235,7 +1235,7 @@ static ssize_t tun_put_user(struct tun_struct *tun,
 {
        struct tun_pi pi = { 0, skb->protocol };
        ssize_t total;
-       int vlan_offset;
+       int vlan_offset = 0;
        int vlan_hlen = 0;
        int vnet_hdr_sz = 0;
 
@@ -1304,6 +1304,8 @@ static ssize_t tun_put_user(struct tun_struct *tun,
 
                if (copy_to_iter(&gso, sizeof(gso), iter) != sizeof(gso))
                        return -EFAULT;
+
+               iov_iter_advance(iter, vnet_hdr_sz - sizeof(gso));
        }
 
        if (vlan_hlen) {