aboutsummaryrefslogtreecommitdiffstats
path: root/net/x25/x25_subr.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/x25/x25_subr.c')
-rw-r--r--net/x25/x25_subr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/x25/x25_subr.c b/net/x25/x25_subr.c
index db0b1315d577..a946c1cfb5a2 100644
--- a/net/x25/x25_subr.c
+++ b/net/x25/x25_subr.c
@@ -363,6 +363,12 @@ void x25_disconnect(struct sock *sk, int reason, unsigned char cause,
sk->sk_state_change(sk);
sock_set_flag(sk, SOCK_DEAD);
}
+ if (x25->neighbour) {
+ read_lock_bh(&x25_list_lock);
+ x25_neigh_put(x25->neighbour);
+ x25->neighbour = NULL;
+ read_unlock_bh(&x25_list_lock);
+ }
}
/*