Commit fecb7efa authored by yangerkun's avatar yangerkun Committed by Khalid Elmously

slip: not call free_netdev before rtnl_unlock in slip_open

BugLink: https://bugs.launchpad.net/bugs/1883918

commit f596c870 upstream.

As the description before netdev_run_todo, we cannot call free_netdev
before rtnl_unlock, fix it by reorder the code.
Signed-off-by: default avataryangerkun <yangerkun@huawei.com>
Reviewed-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
[bwh: Backported to <4.11: free_netdev() is called through sl_free_netdev()]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent df869cca
...@@ -867,7 +867,10 @@ static int slip_open(struct tty_struct *tty) ...@@ -867,7 +867,10 @@ static int slip_open(struct tty_struct *tty)
sl->tty = NULL; sl->tty = NULL;
tty->disc_data = NULL; tty->disc_data = NULL;
clear_bit(SLF_INUSE, &sl->flags); clear_bit(SLF_INUSE, &sl->flags);
/* do not call free_netdev before rtnl_unlock */
rtnl_unlock();
sl_free_netdev(sl->dev); sl_free_netdev(sl->dev);
return err;
err_exit: err_exit:
rtnl_unlock(); rtnl_unlock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment