]> git.hungrycats.org Git - linux/commit
openvswitch: Return vport module ref before destruction
authorThomas Graf <tgraf@suug.ch>
Mon, 30 Mar 2015 11:57:41 +0000 (13:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Apr 2015 08:23:42 +0000 (10:23 +0200)
commit69ed02241c04c6a0515720d079ff49e420d4b2f8
treeae0ac6aa675e09c02da6af5ecfab8f16c0d0db45
parent28cc484cd75f43bc758838c34e7fd48e495cbff6
openvswitch: Return vport module ref before destruction

[ Upstream commit fa2d8ff4e3522b4e05f590575d3eb8087f3a8cdc ]

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@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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/openvswitch/vport.c