Skip to content

Commit

Permalink
xfrm: remove the unnecessary checking before call xfrm_pol_hold
Browse files Browse the repository at this point in the history
xfrm_pol_hold will check its input with NULL

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
  • Loading branch information
Li RongQing authored and Steffen Klassert committed May 5, 2015
1 parent dc0565c commit 586f2eb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1127,8 +1127,8 @@ static struct xfrm_policy *xfrm_policy_lookup_bytype(struct net *net, u8 type,
break;
}
}
if (ret)
xfrm_pol_hold(ret);

xfrm_pol_hold(ret);
fail:
read_unlock_bh(&net->xfrm.xfrm_policy_lock);

Expand Down Expand Up @@ -3211,8 +3211,7 @@ static struct xfrm_policy *xfrm_migrate_policy_find(const struct xfrm_selector *
}
}

if (ret)
xfrm_pol_hold(ret);
xfrm_pol_hold(ret);

read_unlock_bh(&net->xfrm.xfrm_policy_lock);

Expand Down

0 comments on commit 586f2eb

Please sign in to comment.