Skip to content

Commit

Permalink
slip: not call free_netdev before rtnl_unlock in slip_open
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
yangerkun authored and David S. Miller committed Feb 27, 2020
1 parent b6f6118 commit f596c87
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/slip/slip.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,10 @@ static int slip_open(struct tty_struct *tty)
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();
Expand Down

0 comments on commit f596c87

Please sign in to comment.