xfrm: Refcount destination entry on xfrm_lookup
authorSteffen Klassert <steffen.klassert@secunet.com>
Tue, 15 Mar 2011 21:12:49 +0000 (21:12 +0000)
committerBrad Figg <brad.figg@canonical.com>
Wed, 27 Apr 2011 18:42:00 +0000 (11:42 -0700)
commit118946e4c05328b8fef6f7b16805314af131f6b3
tree8bc35b6daf89d367c4b5f1e32afbfed13df32aa9
parent40b35d032e1d35e58c5221cbc4cb5163d5b43928
xfrm: Refcount destination entry on xfrm_lookup

BugLink: http://bugs.launchpad.net/bugs/769042

[ Upstream commit fbd5060875d25f7764fd1c3d35b83a8ed1d88d7b ]

We return a destination entry without refcount if a socket
policy is found in xfrm_lookup. This triggers a warning on
a negative refcount when freeeing this dst entry. So take
a refcount in this case to fix it.

This refcount was forgotten when xfrm changed to cache bundles
instead of policies for outgoing flows.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Acked-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
net/xfrm/xfrm_policy.c