]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tipc: Fix kfree_skb() of uninitialised pointer
authorBen Hutchings <ben@decadent.org.uk>
Tue, 15 Dec 2015 21:21:57 +0000 (21:21 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Jan 2016 04:55:40 +0000 (20:55 -0800)
Commit 7098356baca7 ("tipc: fix error handling of expanding buffer
headroom") added a "goto tx_error".  This is fine upstream, but
when backported to 4.3 it results in attempting to free the clone
before it has been allocated.  In this early error case, no
cleanup is needed.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/tipc/udp_media.c

index 86f2e7c44694a3c4f34218c9984fbd9aed0d3c61..73bdf1baa266e8ff19529e9ab1f7f79ac8e05b14 100644 (file)
@@ -162,7 +162,7 @@ static int tipc_udp_send_msg(struct net *net, struct sk_buff *skb,
        if (skb_headroom(skb) < UDP_MIN_HEADROOM) {
                err = pskb_expand_head(skb, UDP_MIN_HEADROOM, 0, GFP_ATOMIC);
                if (err)
-                       goto tx_error;
+                       return err;
        }
 
        clone = skb_clone(skb, GFP_ATOMIC);