Skip to content

Commit 2091a3d

Browse files
hartkoppdavem330
authored andcommitted
slcan: not call free_netdev before rtnl_unlock in slcan_open
As the description before netdev_run_todo, we cannot call free_netdev before rtnl_unlock, fix it by reorder the code. This patch is a 1:1 copy of upstream slip.c commit f596c87 ("slip: not call free_netdev before rtnl_unlock in slip_open"). Reported-by: yangerkun <[email protected]> Signed-off-by: Oliver Hartkopp <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 06e9bfc commit 2091a3d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/can/slcan.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,10 @@ static int slcan_open(struct tty_struct *tty)
625625
tty->disc_data = NULL;
626626
clear_bit(SLF_INUSE, &sl->flags);
627627
slc_free_netdev(sl->dev);
628+
/* do not call free_netdev before rtnl_unlock */
629+
rtnl_unlock();
628630
free_netdev(sl->dev);
631+
return err;
629632

630633
err_exit:
631634
rtnl_unlock();

0 commit comments

Comments
 (0)