diff options
-rw-r--r-- | net/xfrm/xfrm_user.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 256745321611..924a2fefcd94 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -1557,14 +1557,13 @@ static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1557 | struct xfrm_usersa_info *p = &ue->state; | 1557 | struct xfrm_usersa_info *p = &ue->state; |
1558 | 1558 | ||
1559 | x = xfrm_state_lookup(&p->id.daddr, p->id.spi, p->id.proto, p->family); | 1559 | x = xfrm_state_lookup(&p->id.daddr, p->id.spi, p->id.proto, p->family); |
1560 | err = -ENOENT; | ||
1561 | 1560 | ||
1561 | err = -ENOENT; | ||
1562 | if (x == NULL) | 1562 | if (x == NULL) |
1563 | return err; | 1563 | return err; |
1564 | 1564 | ||
1565 | err = -EINVAL; | ||
1566 | |||
1567 | spin_lock_bh(&x->lock); | 1565 | spin_lock_bh(&x->lock); |
1566 | err = -EINVAL; | ||
1568 | if (x->km.state != XFRM_STATE_VALID) | 1567 | if (x->km.state != XFRM_STATE_VALID) |
1569 | goto out; | 1568 | goto out; |
1570 | km_state_expired(x, ue->hard, current->pid); | 1569 | km_state_expired(x, ue->hard, current->pid); |
@@ -1574,6 +1573,7 @@ static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1574 | xfrm_audit_log(NETLINK_CB(skb).loginuid, NETLINK_CB(skb).sid, | 1573 | xfrm_audit_log(NETLINK_CB(skb).loginuid, NETLINK_CB(skb).sid, |
1575 | AUDIT_MAC_IPSEC_DELSA, 1, NULL, x); | 1574 | AUDIT_MAC_IPSEC_DELSA, 1, NULL, x); |
1576 | } | 1575 | } |
1576 | err = 0; | ||
1577 | out: | 1577 | out: |
1578 | spin_unlock_bh(&x->lock); | 1578 | spin_unlock_bh(&x->lock); |
1579 | xfrm_state_put(x); | 1579 | xfrm_state_put(x); |