diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-02-26 17:52:21 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-02-28 12:41:57 -0500 |
commit | 3a765aa528401c7aec2208f7ed1276b232b24c57 (patch) | |
tree | 68aaefaf32b0869bc2a11d713395c41b2e59d409 /net | |
parent | 2ff7354fe888f46f6629b57e463b0a1eb956c02b (diff) |
[XFRM] xfrm_user: Fix return values of xfrm_add_sa_expire.
As noted by Kent Yoder, this function will always return an
error. Make sure it returns zero on success.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-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); |