diff options
author | Li RongQing <roy.qing.li@gmail.com> | 2015-04-30 05:13:41 -0400 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2015-05-05 03:27:00 -0400 |
commit | 586f2eb416f4271444e807b96346df3d30e8dfb5 (patch) | |
tree | 7aa20c60754f9c177e338ff6023af8fbcbb5a510 /net/xfrm/xfrm_policy.c | |
parent | dc0565ce6e34be06730312e79b226b7408a543c8 (diff) |
xfrm: remove the unnecessary checking before call xfrm_pol_hold
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>
Diffstat (limited to 'net/xfrm/xfrm_policy.c')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index c4c47f337a3a..435bc0dc7630 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -1127,8 +1127,8 @@ static struct xfrm_policy *xfrm_policy_lookup_bytype(struct net *net, u8 type, | |||
1127 | break; | 1127 | break; |
1128 | } | 1128 | } |
1129 | } | 1129 | } |
1130 | if (ret) | 1130 | |
1131 | xfrm_pol_hold(ret); | 1131 | xfrm_pol_hold(ret); |
1132 | fail: | 1132 | fail: |
1133 | read_unlock_bh(&net->xfrm.xfrm_policy_lock); | 1133 | read_unlock_bh(&net->xfrm.xfrm_policy_lock); |
1134 | 1134 | ||
@@ -3211,8 +3211,7 @@ static struct xfrm_policy *xfrm_migrate_policy_find(const struct xfrm_selector * | |||
3211 | } | 3211 | } |
3212 | } | 3212 | } |
3213 | 3213 | ||
3214 | if (ret) | 3214 | xfrm_pol_hold(ret); |
3215 | xfrm_pol_hold(ret); | ||
3216 | 3215 | ||
3217 | read_unlock_bh(&net->xfrm.xfrm_policy_lock); | 3216 | read_unlock_bh(&net->xfrm.xfrm_policy_lock); |
3218 | 3217 | ||