diff options
author | yangerkun <yangerkun@huawei.com> | 2020-02-26 06:54:35 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-02-27 07:37:06 +0300 |
commit | f596c87005f7b1baeb7d62d9a9e25d68c3dfae10 (patch) | |
tree | 7fbf1945f6e80678ad03f8f2c59b06b92224e699 | |
parent | b6f6118901d1e867ac9177bbff3b00b185bd4fdc (diff) | |
download | linux-f596c87005f7b1baeb7d62d9a9e25d68c3dfae10.tar.xz |
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>
-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 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(); |