aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/xfrm/xfrm_user.c')
-rw-r--r--net/xfrm/xfrm_user.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 256745321611..956cfe0ff7f8 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1401,7 +1401,7 @@ static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh,
1401 1401
1402 x = xfrm_state_lookup(&id->daddr, id->spi, id->proto, id->family); 1402 x = xfrm_state_lookup(&id->daddr, id->spi, id->proto, id->family);
1403 if (x == NULL) { 1403 if (x == NULL) {
1404 kfree(r_skb); 1404 kfree_skb(r_skb);
1405 return -ESRCH; 1405 return -ESRCH;
1406 } 1406 }
1407 1407
@@ -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;
1577out: 1577out:
1578 spin_unlock_bh(&x->lock); 1578 spin_unlock_bh(&x->lock);
1579 xfrm_state_put(x); 1579 xfrm_state_put(x);