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>
This commit is contained in:
parent
6e46c8cb3c
commit
93d807401c
|
@ -429,6 +429,7 @@ static int rfcomm_release_dev(void __user *arg)
|
||||||
if (dev->tty)
|
if (dev->tty)
|
||||||
tty_vhangup(dev->tty);
|
tty_vhangup(dev->tty);
|
||||||
|
|
||||||
|
if (!test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags))
|
||||||
rfcomm_dev_del(dev);
|
rfcomm_dev_del(dev);
|
||||||
rfcomm_dev_put(dev);
|
rfcomm_dev_put(dev);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue