aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/slip
diff options
context:
space:
mode:
authoryangerkun2020-02-26 11:54:35 +0800
committerDavid S. Miller2020-02-26 20:37:06 -0800
commitf596c87005f7b1baeb7d62d9a9e25d68c3dfae10 (patch)
tree7fbf1945f6e80678ad03f8f2c59b06b92224e699 /drivers/net/slip
parentb6f6118901d1e867ac9177bbff3b00b185bd4fdc (diff)
slip: not call free_netdev before rtnl_unlock in slip_open
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>
Diffstat (limited to 'drivers/net/slip')
-rw-r--r--drivers/net/slip/slip.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
index 6f4d7ba8b109..babb01888b78 100644
--- a/drivers/net/slip/slip.c
+++ b/drivers/net/slip/slip.c
@@ -863,7 +863,10 @@ err_free_chan:
tty->disc_data = NULL;
clear_bit(SLF_INUSE, &sl->flags);
sl_free_netdev(sl->dev);
+ /* do not call free_netdev before rtnl_unlock */
+ rtnl_unlock();
free_netdev(sl->dev);
+ return err;
err_exit:
rtnl_unlock();