|
Lines 437-443
static int rfcomm_release_dev(void __user *arg)
Link Here
|
| 437 |
tty_kref_put(tty); |
437 |
tty_kref_put(tty); |
| 438 |
} |
438 |
} |
| 439 |
|
439 |
|
| 440 |
if (!test_and_set_bit(RFCOMM_TTY_RELEASED, &dev->flags)) |
440 |
if (!test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags) && |
|
|
441 |
!test_and_set_bit(RFCOMM_TTY_RELEASED, &dev->flags)) |
| 441 |
tty_port_put(&dev->port); |
442 |
tty_port_put(&dev->port); |
| 442 |
|
443 |
|
| 443 |
tty_port_put(&dev->port); |
444 |
tty_port_put(&dev->port); |
|
Lines 673-678
static int rfcomm_tty_install(struct tty_driver *driver, struct tty_struct *tty)
Link Here
|
| 673 |
if (err) |
674 |
if (err) |
| 674 |
rfcomm_tty_cleanup(tty); |
675 |
rfcomm_tty_cleanup(tty); |
| 675 |
|
676 |
|
|
|
677 |
/* take over the tty_port reference if it was created with the |
| 678 |
* flag RFCOMM_RELEASE_ONHUP. This will force the release of the port |
| 679 |
* when the last process closes the tty. This behaviour is expected by |
| 680 |
* userspace. |
| 681 |
*/ |
| 682 |
if (test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags)) |
| 683 |
tty_port_put(&dev->port); |
| 684 |
|
| 676 |
return err; |
685 |
return err; |
| 677 |
} |
686 |
} |
| 678 |
|
687 |
|
|
Lines 1010-1019
static void rfcomm_tty_hangup(struct tty_struct *tty)
Link Here
|
| 1010 |
BT_DBG("tty %p dev %p", tty, dev); |
1019 |
BT_DBG("tty %p dev %p", tty, dev); |
| 1011 |
|
1020 |
|
| 1012 |
tty_port_hangup(&dev->port); |
1021 |
tty_port_hangup(&dev->port); |
| 1013 |
|
|
|
| 1014 |
if (test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags) && |
| 1015 |
!test_and_set_bit(RFCOMM_TTY_RELEASED, &dev->flags)) |
| 1016 |
tty_port_put(&dev->port); |
| 1017 |
} |
1022 |
} |
| 1018 |
|
1023 |
|
| 1019 |
static int rfcomm_tty_tiocmget(struct tty_struct *tty) |
1024 |
static int rfcomm_tty_tiocmget(struct tty_struct *tty) |