Return-Path: Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:36659 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965279AbbLOVWB (ORCPT ); Tue, 15 Dec 2015 16:22:01 -0500 Date: Tue, 15 Dec 2015 21:21:57 +0000 From: Ben Hutchings To: Greg Kroah-Hartman Cc: stable@vger.kernel.org, ying.xue@windriver.com, "David S. Miller" Message-ID: <20151215212156.GQ28542@decadent.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pwWdILMQNxDD/Cps" Content-Disposition: inline Subject: [PATCH 4.3] tipc: Fix kfree_skb() of uninitialised pointer Sender: stable-owner@vger.kernel.org List-ID: --pwWdILMQNxDD/Cps Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 --- net/tipc/udp_media.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c index 86f2e7c..73bdf1b 100644 --- a/net/tipc/udp_media.c +++ b/net/tipc/udp_media.c @@ -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 =3D pskb_expand_head(skb, UDP_MIN_HEADROOM, 0, GFP_ATOMIC); if (err) - goto tx_error; + return err; } =20 clone =3D skb_clone(skb, GFP_ATOMIC); --pwWdILMQNxDD/Cps Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIVAwUBVnCEdOe/yOyVhhEJAQoalxAAqlEtzltk3Bvc1T1+wEd9OFG7qTAggUxE lQTduJ2eXP3uBpKEZVd3oT2wZp5XRt89juGxiYYvn/uKPeQvDewSQkxdgSWK3uz4 vm/bgGOageIYQ54FzU4doPvGHf1+i+YU3Kv/nHyiShv8LmJxgsU2o4C70jUKgeMP ynqqeqoj6kIJR3kGiuZFxc9j0sAHM7py3zas1FTf2cZ5hle26QFHXUJhn92Bvryb ike20xQf8gd8LY+raWcOlntVWSAZ6Yj5yKyqjEakxhZhewfgg0O2dVKco0YnWepW IKsyLnQMIzzLMgKrP+KH0zhKmw3ByTlJBwm8/dbMxsyeTRBjnCzyeaI2XHqcXJla HENQJBdNSsMrImH8ewSrcBW012X5xiPhY6U0Dr2Bx6mcIHvEDiSLaJeHqPK40iUY Qf007unqY53K2slZxHpqi5R7rcEAg5yWoyxES4Bb2521TS0GD3QqxOGtnBSRhuCb cXWG5tMEJdxbYs+pMuKu1FgbZGb3Nh5BW8iyG0befzOmHnn0Ww0vhJi4EWam6an3 fdUo2BXK5f/ifqhL9XIJPOOAG6ZxxUoUfpL+UNvRVirqBCySyaMlQFloYEj1zCty xCcaPpHe2AW1fbhAOYPN5AHjDwbVMfAJUSzAgeTn14kL2gdEeiwe1xE0ppn1Koau SZZRXpQ8950= =Edw1 -----END PGP SIGNATURE----- --pwWdILMQNxDD/Cps--