lkml.org 
[lkml]   [2020]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net] drivers/net/wan/x25_asy: Keep the ldisc running even when netif is down
From
From: Xie He <xie.he.0141@gmail.com>
Date: Sat, 26 Sep 2020 13:56:10 -0700

> @@ -265,7 +269,9 @@ static void x25_asy_write_wakeup(struct tty_struct *tty)
> * transmission of another packet */
> sl->dev->stats.tx_packets++;
> clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
> - x25_asy_unlock(sl);
> + /* FIXME: The netif may go down after netif_running returns */
> + if (netif_running(sl->dev))
> + x25_asy_unlock(sl);
> return;

It could also go back down and also back up again after you do this
test. Maybe even 10 or 100 times over.

You can't just leave things so incredibly racy like this, please apply
proper synchronization between netdev state changes and this TTY code.

Thank you.

\
 
 \ /
  Last update: 2020-09-29 01:19    [W:0.035 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site