diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-03-21 21:16:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-21 21:16:39 -0400 |
commit | 674f2115995b7b588cbf3540c9f9b2448a8c7ea8 (patch) | |
tree | bd9bd1afa880531f6de70bea970aa198924f8632 /net | |
parent | 20246a800389fe5442675c59863fec5a4f520c7c (diff) |
ipx: fix ipx_release()
Commit b0d0d915d1d1a0 (remove the BKL) added a regression, because
sock_put() can free memory while we are going to use it later.
Fix is to delay sock_put() _after_ release_sock().
Reported-by: Ingo Molnar <mingo@elte.hu>
Tested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipx/af_ipx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index 2731b51923d1..9680226640ef 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c | |||
@@ -148,7 +148,6 @@ static void ipx_destroy_socket(struct sock *sk) | |||
148 | ipx_remove_socket(sk); | 148 | ipx_remove_socket(sk); |
149 | skb_queue_purge(&sk->sk_receive_queue); | 149 | skb_queue_purge(&sk->sk_receive_queue); |
150 | sk_refcnt_debug_dec(sk); | 150 | sk_refcnt_debug_dec(sk); |
151 | sock_put(sk); | ||
152 | } | 151 | } |
153 | 152 | ||
154 | /* | 153 | /* |
@@ -1404,6 +1403,7 @@ static int ipx_release(struct socket *sock) | |||
1404 | sk_refcnt_debug_release(sk); | 1403 | sk_refcnt_debug_release(sk); |
1405 | ipx_destroy_socket(sk); | 1404 | ipx_destroy_socket(sk); |
1406 | release_sock(sk); | 1405 | release_sock(sk); |
1406 | sock_put(sk); | ||
1407 | out: | 1407 | out: |
1408 | return 0; | 1408 | return 0; |
1409 | } | 1409 | } |