Skip to contentSkip to conversation

slcan: not call free_netdev before rtnl_unlock in slcan_open

PATCH Applied Oliver Hartkopp 2 participants 2 messages Mar 21, 2020 – Mar 22, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 f596c87005f7 ("slip: not call free_netdev before rtnl_unlock in slip_open").

---
 drivers/net/can/slcan.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/can/slcan.c +3 -0
index 2f5c287eac95..a3664281a33f 100644
@@ -625,7 +625,10 @@ static int slcan_open(struct tty_struct *tty)
 	tty->disc_data = NULL;
 	clear_bit(SLF_INUSE, &sl->flags);
 	slc_free_netdev(sl->dev);
+	/* do not call free_netdev before rtnl_unlock */
+	rtnl_unlock();
 	free_netdev(sl->dev);
+	return err;
 
 err_exit:
 	rtnl_unlock();
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw

From: Oliver Hartkopp <[email protected]>
Date: Sat, 21 Mar 2020 14:08:29 +0100

Quoted 8 lines

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 f596c87005f7 ("slip: not call free_netdev before rtnl_unlock in slip_open").

Applied, thanks Oliver.