diff mbox

[PATCHv2] ipv6: Fix inet6_init() cleanup order

Message ID 1384633044-26453-1-git-send-email-vyasevich@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Vladislav Yasevich Nov. 16, 2013, 8:17 p.m. UTC
Commit 6d0bfe22611602f36617bc7aa2ffa1bbb2f54c67
	net: ipv6: Add IPv6 support to the ping socket

introduced a change in the cleanup logic of inet6_init and
has a bug in that ipv6_packet_cleanup() may not be called.
Fix the cleanup ordering.

CC: Hannes Frederic Sowa <hannes@stressinduktion.org>
CC: Lorenzo Colitti <lorenzo@google.com>
CC: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
---
 net/ipv6/af_inet6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Hannes Frederic Sowa Nov. 16, 2013, 8:26 p.m. UTC | #1
On Sat, Nov 16, 2013 at 03:17:24PM -0500, Vlad Yasevich wrote:
> Commit 6d0bfe22611602f36617bc7aa2ffa1bbb2f54c67
> 	net: ipv6: Add IPv6 support to the ping socket
> 
> introduced a change in the cleanup logic of inet6_init and
> has a bug in that ipv6_packet_cleanup() may not be called.
> Fix the cleanup ordering.
> 
> CC: Hannes Frederic Sowa <hannes@stressinduktion.org>
> CC: Lorenzo Colitti <lorenzo@google.com>
> CC: Fabio Estevam <fabio.estevam@freescale.com>
> Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>

Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

Thanks,

  Hannes

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Nov. 18, 2013, 8:39 p.m. UTC | #2
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Sat, 16 Nov 2013 21:26:46 +0100

> On Sat, Nov 16, 2013 at 03:17:24PM -0500, Vlad Yasevich wrote:
>> Commit 6d0bfe22611602f36617bc7aa2ffa1bbb2f54c67
>> 	net: ipv6: Add IPv6 support to the ping socket
>> 
>> introduced a change in the cleanup logic of inet6_init and
>> has a bug in that ipv6_packet_cleanup() may not be called.
>> Fix the cleanup ordering.
>> 
>> CC: Hannes Frederic Sowa <hannes@stressinduktion.org>
>> CC: Lorenzo Colitti <lorenzo@google.com>
>> CC: Fabio Estevam <fabio.estevam@freescale.com>
>> Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
> 
> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

Looks great, thanks for sorting this out properly.

I'll queue this up for -stable as well.

Thanks again!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 6468bda..56ca35b 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -958,10 +958,10 @@  out:
 
 #ifdef CONFIG_SYSCTL
 sysctl_fail:
-	ipv6_packet_cleanup();
+	pingv6_exit();
 #endif
 pingv6_fail:
-	pingv6_exit();
+	ipv6_packet_cleanup();
 ipv6_packet_fail:
 	tcpv6_exit();
 tcpv6_fail: