We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0acc442 commit fb855e9Copy full SHA for fb855e9
drivers/net/can/slcan/slcan-core.c
@@ -864,12 +864,14 @@ static void slcan_close(struct tty_struct *tty)
864
{
865
struct slcan *sl = (struct slcan *)tty->disc_data;
866
867
- /* unregister_netdev() calls .ndo_stop() so we don't have to.
868
- * Our .ndo_stop() also flushes the TTY write wakeup handler,
869
- * so we can safely set sl->tty = NULL after this.
870
- */
871
unregister_candev(sl->dev);
872
+ /*
+ * The netdev needn't be UP (so .ndo_stop() is not called). Hence make
+ * sure this is not running before freeing it up.
+ */
873
+ flush_work(&sl->tx_work);
874
+
875
/* Mark channel as dead */
876
spin_lock_bh(&sl->lock);
877
tty->disc_data = NULL;
0 commit comments