Skip to content

Commit ffe6b68

Browse files
funnydogGustavo Padovan
authored andcommitted
Bluetooth: Purge the dlc->tx_queue to avoid circular dependency
In rfcomm_tty_cleanup we purge the dlc->tx_queue which may contain socket buffers referencing the tty_port and thus preventing the tty_port destruction. Signed-off-by: Gianluca Anzolin <[email protected]> Reviewed-by: Peter Hurley <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
1 parent ece3150 commit ffe6b68

File tree

1 file changed

+6
-0
lines changed
  • net/bluetooth/rfcomm

1 file changed

+6
-0
lines changed

net/bluetooth/rfcomm/tty.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,12 @@ static void rfcomm_tty_cleanup(struct tty_struct *tty)
668668
tty->driver_data = NULL;
669669
rfcomm_dlc_unlock(dev->dlc);
670670

671+
/*
672+
* purge the dlc->tx_queue to avoid circular dependencies
673+
* between dev and dlc
674+
*/
675+
skb_queue_purge(&dev->dlc->tx_queue);
676+
671677
tty_port_put(&dev->port);
672678
}
673679

0 commit comments

Comments
 (0)