From 0b75446a26c68f2a9f2dd3a9112b34fc81ffc0cb Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 2 Jun 2008 10:16:34 -0700 Subject: [PATCH] Don't try to destroy dp_dev while the local port holds a reference to it. Fixes a message output at deldp time: unregister_netdevice: waiting for of0 to become free. Usage count = 1 Thanks to Murphy and Justin for reporting this bug. --- datapath/datapath.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index c87fa241..adc69806 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -408,7 +408,6 @@ static void del_dp(struct datapath *dp) { struct net_bridge_port *p; - dp_dev_destroy(dp); kthread_stop(dp->dp_task); /* Drop references to DP. */ @@ -416,6 +415,10 @@ static void del_dp(struct datapath *dp) del_switch_port(p); rcu_assign_pointer(dps[dp->dp_idx], NULL); + /* Destroy dp->netdev. (Must follow deleting switch ports since + * dp->local_port has a reference to it.) */ + dp_dev_destroy(dp); + /* Wait until no longer in use, then destroy it. */ synchronize_rcu(); chain_destroy(dp->chain); -- 2.30.2