[XFRM]: Always release dst_entry on error in xfrm_lookup
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
cf0b450cd5
commit
e104411b82
@@ -765,8 +765,8 @@ restart:
|
||||
switch (policy->action) {
|
||||
case XFRM_POLICY_BLOCK:
|
||||
/* Prohibit the flow */
|
||||
xfrm_pol_put(policy);
|
||||
return -EPERM;
|
||||
err = -EPERM;
|
||||
goto error;
|
||||
|
||||
case XFRM_POLICY_ALLOW:
|
||||
if (policy->xfrm_nr == 0) {
|
||||
@@ -782,8 +782,8 @@ restart:
|
||||
*/
|
||||
dst = xfrm_find_bundle(fl, policy, family);
|
||||
if (IS_ERR(dst)) {
|
||||
xfrm_pol_put(policy);
|
||||
return PTR_ERR(dst);
|
||||
err = PTR_ERR(dst);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (dst)
|
||||
|
Reference in New Issue
Block a user