diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2008-10-06 15:54:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-06 15:54:57 -0400 |
commit | 859f4c74d8de4dc344b3a115367d5e22a79bddaf (patch) | |
tree | 4e91e7053094c5b71c00fdc7e018f2262cfbbfd4 /net/netrom | |
parent | 33d1d2c52c3befa6c4df33b4ba58137d1c48894b (diff) |
netrom: Fix sock_orphan() use in nr_release
While debugging another bug it was found that NetRom socks
are sometimes seen unorphaned in sk_free(). This patch moves
sock_orphan() in nr_release() to the beginning (like in ax25,
or rose).
Reported-and-tested-by: Bernard Pidoux f6bvp <f6bvp@free.fr>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netrom')
-rw-r--r-- | net/netrom/af_netrom.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 532e4faa29f7..9f1ea4a27b35 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c | |||
@@ -525,6 +525,7 @@ static int nr_release(struct socket *sock) | |||
525 | if (sk == NULL) return 0; | 525 | if (sk == NULL) return 0; |
526 | 526 | ||
527 | sock_hold(sk); | 527 | sock_hold(sk); |
528 | sock_orphan(sk); | ||
528 | lock_sock(sk); | 529 | lock_sock(sk); |
529 | nr = nr_sk(sk); | 530 | nr = nr_sk(sk); |
530 | 531 | ||
@@ -548,7 +549,6 @@ static int nr_release(struct socket *sock) | |||
548 | sk->sk_state = TCP_CLOSE; | 549 | sk->sk_state = TCP_CLOSE; |
549 | sk->sk_shutdown |= SEND_SHUTDOWN; | 550 | sk->sk_shutdown |= SEND_SHUTDOWN; |
550 | sk->sk_state_change(sk); | 551 | sk->sk_state_change(sk); |
551 | sock_orphan(sk); | ||
552 | sock_set_flag(sk, SOCK_DESTROY); | 552 | sock_set_flag(sk, SOCK_DESTROY); |
553 | break; | 553 | break; |
554 | 554 | ||