diff options
author | David S. Miller <davem@davemloft.net> | 2020-01-26 10:40:21 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-01-26 10:40:21 +0100 |
commit | 4d8773b68e83558025303f266070b31bc4101e73 (patch) | |
tree | 151cafa469fbc6a411d36b58ab802f67869cc0bb /drivers/net/slip | |
parent | 3333e50b64fe30b7e53cf02456a2f567f689ae4f (diff) | |
parent | 2821e26f3a0a3872184581caac8115bb02641941 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Minor conflict in mlx5 because changes happened to code that has
moved meanwhile.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/slip')
-rw-r--r-- | drivers/net/slip/slip.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c index 317d3a8df316..6f4d7ba8b109 100644 --- a/drivers/net/slip/slip.c +++ b/drivers/net/slip/slip.c @@ -452,9 +452,16 @@ static void slip_transmit(struct work_struct *work) */ static void slip_write_wakeup(struct tty_struct *tty) { - struct slip *sl = tty->disc_data; + struct slip *sl; + + rcu_read_lock(); + sl = rcu_dereference(tty->disc_data); + if (!sl) + goto out; schedule_work(&sl->tx_work); +out: + rcu_read_unlock(); } static void sl_tx_timeout(struct net_device *dev, unsigned int txqueue) @@ -882,10 +889,11 @@ static void slip_close(struct tty_struct *tty) return; spin_lock_bh(&sl->lock); - tty->disc_data = NULL; + rcu_assign_pointer(tty->disc_data, NULL); sl->tty = NULL; spin_unlock_bh(&sl->lock); + synchronize_rcu(); flush_work(&sl->tx_work); /* VSV = very important to remove timers */ |