datapath: Fix namespace refcount leak on failed init.
authorJesse Gross <jesse@nicira.com>
Wed, 22 Aug 2012 00:48:54 +0000 (17:48 -0700)
committerJesse Gross <jesse@nicira.com>
Wed, 22 Aug 2012 21:41:01 +0000 (14:41 -0700)
commit0ceaa66c393bb7e59126e66d578dd2b8431c2a49
tree1505d5ef428662f5eebb6141672584292c534b74
parent6019f124107ff8f86ecc1dc65fde64cf935ac7d8
datapath: Fix namespace refcount leak on failed init.

If a datapath fails to initialze fully (likely due to out-of-memory)
then it's possible that we can take a reference to a network
namespace but never release it.  This fixes the problem by releasing
any resources in the event of an error.

Found by code inspection, it's likely to be extremely rare in practice.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
datapath/datapath.c