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

Coverity #632
Signed-off-by: Dave Jones <[EMAIL PROTECTED]>

--- linux-2.6/drivers/net/tun.c~        2006-03-08 22:43:54.000000000 -0500
+++ linux-2.6/drivers/net/tun.c 2006-03-08 22:46:16.000000000 -0500
@@ -249,8 +249,11 @@ static __inline__ ssize_t tun_get_user(s
 
        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) {

-- 
http://www.codemonkey.org.uk
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to