summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/mISDN/socket.c
diff options
context:
space:
mode:
authorAndreas Eversberg <andreas@eversberg.eu>2008-09-14 14:42:18 +0200
committerKarsten Keil <kkeil@suse.de>2009-01-09 22:44:27 +0100
commit9a812553bdc097a566aa79df7fae3457449c555b (patch)
tree583d34c7c743730775cd186f1b3e856bf1f97c90 /drivers/isdn/mISDN/socket.c
parent1b4d33121f1d991f6ae226cc3333428ff87627bb (diff)
mISDN: Correct busy device detection
Correct busy device detection. This fix belongs to last commit. Signed-off-by: Andreas Eversberg <andreas@eversberg.eu> Signed-off-by: Karsten Keil <kkeil@suse.de>
Diffstat (limited to 'drivers/isdn/mISDN/socket.c')
-rw-r--r--drivers/isdn/mISDN/socket.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index 916569ca156..508945d1b9c 100644
--- a/drivers/isdn/mISDN/socket.c
+++ b/drivers/isdn/mISDN/socket.c
@@ -483,22 +483,24 @@ data_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
goto done;
}
- read_lock_bh(&data_sockets.lock);
- sk_for_each(csk, node, &data_sockets.head) {
- if (sk == csk)
- continue;
- if (_pms(csk)->dev != _pms(sk)->dev)
- continue;
- if (csk->sk_protocol >= ISDN_P_B_START)
- continue;
- if (IS_ISDN_P_TE(csk->sk_protocol)
- == IS_ISDN_P_TE(sk->sk_protocol))
- continue;
+ if (sk->sk_protocol < ISDN_P_B_START) {
+ read_lock_bh(&data_sockets.lock);
+ sk_for_each(csk, node, &data_sockets.head) {
+ if (sk == csk)
+ continue;
+ if (_pms(csk)->dev != _pms(sk)->dev)
+ continue;
+ if (csk->sk_protocol >= ISDN_P_B_START)
+ continue;
+ if (IS_ISDN_P_TE(csk->sk_protocol)
+ == IS_ISDN_P_TE(sk->sk_protocol))
+ continue;
+ read_unlock_bh(&data_sockets.lock);
+ err = -EBUSY;
+ goto done;
+ }
read_unlock_bh(&data_sockets.lock);
- err = -EBUSY;
- goto done;
}
- read_unlock_bh(&data_sockets.lock);
_pms(sk)->ch.send = mISDN_send;
_pms(sk)->ch.ctrl = mISDN_ctrl;