aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <andreas@eversberg.eu>2008-09-14 08:42:18 -0400
committerKarsten Keil <kkeil@suse.de>2009-01-09 16:44:27 -0500
commit9a812553bdc097a566aa79df7fae3457449c555b (patch)
tree583d34c7c743730775cd186f1b3e856bf1f97c90
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>
-rw-r--r--drivers/isdn/mISDN/socket.c30
-rw-r--r--drivers/isdn/mISDN/stack.c3
2 files changed, 18 insertions, 15 deletions
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index 916569ca156d..508945d1b9c1 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)
483 goto done; 483 goto done;
484 } 484 }
485 485
486 read_lock_bh(&data_sockets.lock); 486 if (sk->sk_protocol < ISDN_P_B_START) {
487 sk_for_each(csk, node, &data_sockets.head) { 487 read_lock_bh(&data_sockets.lock);
488 if (sk == csk) 488 sk_for_each(csk, node, &data_sockets.head) {
489 continue; 489 if (sk == csk)
490 if (_pms(csk)->dev != _pms(sk)->dev) 490 continue;
491 continue; 491 if (_pms(csk)->dev != _pms(sk)->dev)
492 if (csk->sk_protocol >= ISDN_P_B_START) 492 continue;
493 continue; 493 if (csk->sk_protocol >= ISDN_P_B_START)
494 if (IS_ISDN_P_TE(csk->sk_protocol) 494 continue;
495 == IS_ISDN_P_TE(sk->sk_protocol)) 495 if (IS_ISDN_P_TE(csk->sk_protocol)
496 continue; 496 == IS_ISDN_P_TE(sk->sk_protocol))
497 continue;
498 read_unlock_bh(&data_sockets.lock);
499 err = -EBUSY;
500 goto done;
501 }
497 read_unlock_bh(&data_sockets.lock); 502 read_unlock_bh(&data_sockets.lock);
498 err = -EBUSY;
499 goto done;
500 } 503 }
501 read_unlock_bh(&data_sockets.lock);
502 504
503 _pms(sk)->ch.send = mISDN_send; 505 _pms(sk)->ch.send = mISDN_send;
504 _pms(sk)->ch.ctrl = mISDN_ctrl; 506 _pms(sk)->ch.ctrl = mISDN_ctrl;
diff --git a/drivers/isdn/mISDN/stack.c b/drivers/isdn/mISDN/stack.c
index 63afa8cf9e07..e2f45019ebf0 100644
--- a/drivers/isdn/mISDN/stack.c
+++ b/drivers/isdn/mISDN/stack.c
@@ -446,7 +446,8 @@ connect_layer1(struct mISDNdevice *dev, struct mISDNchannel *ch,
446 rq.protocol = protocol; 446 rq.protocol = protocol;
447 rq.adr.channel = adr->channel; 447 rq.adr.channel = adr->channel;
448 err = dev->D.ctrl(&dev->D, OPEN_CHANNEL, &rq); 448 err = dev->D.ctrl(&dev->D, OPEN_CHANNEL, &rq);
449 printk(KERN_DEBUG "%s: ret 1 %d\n", __func__, err); 449 printk(KERN_DEBUG "%s: ret %d (dev %d)\n", __func__, err,
450 dev->id);
450 if (err) 451 if (err)
451 return err; 452 return err;
452 write_lock_bh(&dev->D.st->l1sock.lock); 453 write_lock_bh(&dev->D.st->l1sock.lock);