diff options
author | Dave Young <hidave.darkstar@gmail.com> | 2008-02-05 06:12:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-02-05 06:12:06 -0500 |
commit | 93d807401ced2320d0d1e56bf9de099bba5c0424 (patch) | |
tree | 8d9a471779124e7dea089ec59933b20d4c7480f4 | |
parent | 6e46c8cb3cbfa7bafe78d43a3d57750605a2dfa3 (diff) |
bluetooth rfcomm tty: destroy before tty_close()
rfcomm dev could be deleted in tty_hangup, so we must not call
rfcomm_dev_del again to prevent from destroying rfcomm dev before tty
close.
Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/bluetooth/rfcomm/tty.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index 788c70321858..e4c779bb8d76 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c | |||
@@ -429,7 +429,8 @@ static int rfcomm_release_dev(void __user *arg) | |||
429 | if (dev->tty) | 429 | if (dev->tty) |
430 | tty_vhangup(dev->tty); | 430 | tty_vhangup(dev->tty); |
431 | 431 | ||
432 | rfcomm_dev_del(dev); | 432 | if (!test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags)) |
433 | rfcomm_dev_del(dev); | ||
433 | rfcomm_dev_put(dev); | 434 | rfcomm_dev_put(dev); |
434 | return 0; | 435 | return 0; |
435 | } | 436 | } |