Commit 8f22757e authored by Dave Jones's avatar Dave Jones Committed by David S. Miller

[TUN]: Fix leak in tun_get_user()

We're leaking an skb in a failure path in this function.

Coverity #632
Signed-off-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 53574487
......@@ -249,8 +249,11 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv,
if (align)
skb_reserve(skb, align);
if (memcpy_fromiovec(skb_put(skb, len), iv, len))
if (memcpy_fromiovec(skb_put(skb, len), iv, len)) {
tun->stats.rx_dropped++;
kfree_skb(skb);
return -EFAULT;
}
skb->dev = tun->dev;
switch (tun->flags & TUN_TYPE_MASK) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment