aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2010-05-16 02:49:26 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-16 02:49:26 -0400
commita1aa3483041bd3691c7f029272ccef4ce70bd957 (patch)
tree10aae3a5100a85fad5ca81da37e4bf1b064d29bb /net/xfrm
parenta14462f1bd4d3962994f518459102000438665aa (diff)
xfrm: fix policy unreferencing on larval drop
I mistakenly had the error path to use num_pols to decide how many policies we need to drop (cruft from earlier patch set version which did not handle socket policies right). This is wrong since normally we do not keep explicit references (instead we hold reference to the cache entry which holds references to policies). drop_pols is set to num_pols if we are holding the references, so use that. Otherwise we eventually BUG_ON inside xfrm_policy_destroy due to premature policy deletion. Signed-off-by: Timo Teras <timo.teras@iki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_policy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 31f4ba43b48f..f4ea3a08e5a1 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1805,7 +1805,7 @@ restart:
1805 /* EREMOTE tells the caller to generate 1805 /* EREMOTE tells the caller to generate
1806 * a one-shot blackhole route. */ 1806 * a one-shot blackhole route. */
1807 dst_release(dst); 1807 dst_release(dst);
1808 xfrm_pols_put(pols, num_pols); 1808 xfrm_pols_put(pols, drop_pols);
1809 XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTNOSTATES); 1809 XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTNOSTATES);
1810 return -EREMOTE; 1810 return -EREMOTE;
1811 } 1811 }