aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'net/x25/af_x25.c')
-rw-r--r--net/x25/af_x25.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index f43d037ea852..77d8adb27ec7 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -551,7 +551,7 @@ static int x25_create(struct net *net, struct socket *sock, int protocol,
551 if (protocol) 551 if (protocol)
552 goto out; 552 goto out;
553 553
554 rc = -ENOBUFS; 554 rc = -ENOMEM;
555 if ((sk = x25_alloc_socket(net, kern)) == NULL) 555 if ((sk = x25_alloc_socket(net, kern)) == NULL)
556 goto out; 556 goto out;
557 557
@@ -1797,10 +1797,15 @@ void x25_kill_by_neigh(struct x25_neigh *nb)
1797 1797
1798 write_lock_bh(&x25_list_lock); 1798 write_lock_bh(&x25_list_lock);
1799 1799
1800 sk_for_each(s, &x25_list) 1800 sk_for_each(s, &x25_list) {
1801 if (x25_sk(s)->neighbour == nb) 1801 if (x25_sk(s)->neighbour == nb) {
1802 write_unlock_bh(&x25_list_lock);
1803 lock_sock(s);
1802 x25_disconnect(s, ENETUNREACH, 0, 0); 1804 x25_disconnect(s, ENETUNREACH, 0, 0);
1803 1805 release_sock(s);
1806 write_lock_bh(&x25_list_lock);
1807 }
1808 }
1804 write_unlock_bh(&x25_list_lock); 1809 write_unlock_bh(&x25_list_lock);
1805 1810
1806 /* Remove any related forwards */ 1811 /* Remove any related forwards */