]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
bluetooth rfcomm tty: destroy before tty_close()
authorDave Young <hidave.darkstar@gmail.com>
Tue, 5 Feb 2008 11:12:06 +0000 (03:12 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Feb 2008 11:12:06 +0000 (03:12 -0800)
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>
net/bluetooth/rfcomm/tty.c

index 788c70321858f39576867de05e4ec2c885d9445e..e4c779bb8d76e6cf9dfab3b82a3ae33f7276dc68 100644 (file)
@@ -429,7 +429,8 @@ static int rfcomm_release_dev(void __user *arg)
        if (dev->tty)
                tty_vhangup(dev->tty);
 
-       rfcomm_dev_del(dev);
+       if (!test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags))
+               rfcomm_dev_del(dev);
        rfcomm_dev_put(dev);
        return 0;
 }