Skip to content

Commit

Permalink
bluetooth rfcomm tty: destroy before tty_close()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dave Young authored and David S. Miller committed Feb 5, 2008
1 parent 6e46c8c commit 93d8074
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/bluetooth/rfcomm/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 93d8074

Please sign in to comment.