aboutsummaryrefslogtreecommitdiffstats
path: root/net/x25/x25_out.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-01-22 17:44:59 -0500
committerArnd Bergmann <arnd@arndb.de>2011-03-05 04:55:45 -0500
commit77b2283604bdd7053494a97b0e2fee97148206c6 (patch)
tree4d5c54156d64fd80de765cc18dc7e4a68b5ec5e1 /net/x25/x25_out.c
parent788257d6101d986ac8f2741aaa35974af47f574c (diff)
x25: remove the BKL
This replaces all instances of lock_kernel in x25 with lock_sock, taking care to release the socket lock around sleeping functions (sock_alloc_send_skb and skb_recv_datagram). It is not clear whether this is a correct solution, but it seem to be what other protocols do in the same situation. Includes a fix suggested by Eric Dumazet. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: David S. Miller <davem@davemloft.net> Tested-by: Andrew Hendry <andrew.hendry@gmail.com> Cc: linux-x25@vger.kernel.org Cc: netdev@vger.kernel.org Cc: Eric Dumazet <eric.dumazet@gmail.com>
Diffstat (limited to 'net/x25/x25_out.c')
-rw-r--r--net/x25/x25_out.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/x25/x25_out.c b/net/x25/x25_out.c
index d00649fb251d..0144271d2184 100644
--- a/net/x25/x25_out.c
+++ b/net/x25/x25_out.c
@@ -68,8 +68,11 @@ int x25_output(struct sock *sk, struct sk_buff *skb)
68 frontlen = skb_headroom(skb); 68 frontlen = skb_headroom(skb);
69 69
70 while (skb->len > 0) { 70 while (skb->len > 0) {
71 if ((skbn = sock_alloc_send_skb(sk, frontlen + max_len, 71 release_sock(sk);
72 noblock, &err)) == NULL){ 72 skbn = sock_alloc_send_skb(sk, frontlen + max_len,
73 noblock, &err);
74 lock_sock(sk);
75 if (!skbn) {
73 if (err == -EWOULDBLOCK && noblock){ 76 if (err == -EWOULDBLOCK && noblock){
74 kfree_skb(skb); 77 kfree_skb(skb);
75 return sent; 78 return sent;