diff options
Diffstat (limited to 'net/xfrm/xfrm_user.c')
-rw-r--r-- | net/xfrm/xfrm_user.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 8e10e9098a83..52c7fce54641 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -784,16 +784,11 @@ static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
784 | if (x == NULL) | 784 | if (x == NULL) |
785 | goto out_noput; | 785 | goto out_noput; |
786 | 786 | ||
787 | resp_skb = ERR_PTR(-ENOENT); | 787 | err = xfrm_alloc_spi(x, p->min, p->max); |
788 | 788 | if (err) | |
789 | spin_lock_bh(&x->lock); | 789 | goto out; |
790 | if (x->km.state != XFRM_STATE_DEAD) { | ||
791 | xfrm_alloc_spi(x, htonl(p->min), htonl(p->max)); | ||
792 | if (x->id.spi) | ||
793 | resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq); | ||
794 | } | ||
795 | spin_unlock_bh(&x->lock); | ||
796 | 790 | ||
791 | resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq); | ||
797 | if (IS_ERR(resp_skb)) { | 792 | if (IS_ERR(resp_skb)) { |
798 | err = PTR_ERR(resp_skb); | 793 | err = PTR_ERR(resp_skb); |
799 | goto out; | 794 | goto out; |