]> git.baikalelectronics.ru Git - kernel.git/commit
openvswitch: Return vport module ref before destruction
authorThomas Graf <tgraf@suug.ch>
Mon, 30 Mar 2015 11:57:41 +0000 (13:57 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Mar 2015 19:59:50 +0000 (15:59 -0400)
commit480cac0da56d01195682b633c6be4ad2adccf5dc
tree20fa81f468f65e08a7e2470397f7fbf142cb5ca4
parentfa1efe4159168cc59827c86d62db7308b63d945b
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: 78d62d3e4e02 ("ovs: Turn vports with dependencies into separate modules")
Reported-by: Pravin Shelar <pshelar@nicira.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/openvswitch/vport.c