summaryrefslogtreecommitdiffstats
path: root/kernel/net/ax25/af_ax25.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/net/ax25/af_ax25.c')
-rw-r--r--kernel/net/ax25/af_ax25.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/net/ax25/af_ax25.c b/kernel/net/ax25/af_ax25.c
index fbd0acf80..2fdebabbf 100644
--- a/kernel/net/ax25/af_ax25.c
+++ b/kernel/net/ax25/af_ax25.c
@@ -976,7 +976,8 @@ static int ax25_release(struct socket *sock)
release_sock(sk);
ax25_disconnect(ax25, 0);
lock_sock(sk);
- ax25_destroy_socket(ax25);
+ if (!sock_flag(ax25->sk, SOCK_DESTROY))
+ ax25_destroy_socket(ax25);
break;
case AX25_STATE_3: