[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <9cf67a5f127d80bb7db0bd1af1e33505f93e1a01.1427715582.git.tgraf@suug.ch>
Date: Mon, 30 Mar 2015 13:57:41 +0200
From: Thomas Graf <tgraf@...g.ch>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, dev@...nvswitch.org, pshelar@...ira.com
Subject: [PATCH net] openvswitch: Return vport module ref before destruction
Return module reference before invoking the respective vport
->destroy() function. This is needed as ovs_vport_del() is not
invoked inside an RCU read side critical section so the kfree
can occur immediately before returning to ovs_vport_del().
Returning the module reference before ->destroy() is safe because
the module unregistration is blocked on ovs_lock which we hold
while destroying the datapath.
Fixes: 62b9c8d0372d ("ovs: Turn vports with dependencies into separate modules")
Reported-by: Pravin Shelar <pshelar@...ira.com>
Signed-off-by: Thomas Graf <tgraf@...g.ch>
---
@Dave: Please also queue for 3.19.x stable series
net/openvswitch/vport.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
index ec2954f..067a3ff 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
@@ -274,10 +274,8 @@ void ovs_vport_del(struct vport *vport)
ASSERT_OVSL();
hlist_del_rcu(&vport->hash_node);
-
- vport->ops->destroy(vport);
-
module_put(vport->ops->owner);
+ vport->ops->destroy(vport);
}
/**
--
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists