diff options
author | yangerkun <yangerkun@huawei.com> | 2020-02-26 11:54:35 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-06-11 09:21:38 +0200 |
commit | fb586519dec413d455791267daf16925853faecd (patch) | |
tree | 18f3c87a48400ed978c6ffaa820110b8c04a49d4 /drivers | |
parent | ab3ec512a1bd9a8269dc8292aff9bb12ce83ba83 (diff) | |
download | linux-stable-fb586519dec413d455791267daf16925853faecd.tar.gz linux-stable-fb586519dec413d455791267daf16925853faecd.tar.bz2 linux-stable-fb586519dec413d455791267daf16925853faecd.zip |
slip: not call free_netdev before rtnl_unlock in slip_open
commit f596c87005f7b1baeb7d62d9a9e25d68c3dfae10 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: yangerkun <yangerkun@huawei.com>
Reviewed-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to <4.11: free_netdev() is called through sl_free_netdev()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/slip/slip.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c index d4a33baa33b6..3132cf4626a8 100644 --- a/drivers/net/slip/slip.c +++ b/drivers/net/slip/slip.c @@ -867,7 +867,10 @@ err_free_chan: sl->tty = NULL; tty->disc_data = NULL; clear_bit(SLF_INUSE, &sl->flags); + /* do not call free_netdev before rtnl_unlock */ + rtnl_unlock(); sl_free_netdev(sl->dev); + return err; err_exit: rtnl_unlock(); |