Skip to content

Commit

Permalink
esp4: fix error return code in esp_output()
Browse files Browse the repository at this point in the history
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Apr 15, 2013
1 parent 8f3359b commit 06848c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/ipv4/esp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb)

/* skb is pure payload to encrypt */

err = -ENOMEM;

esp = x->data;
aead = esp->aead;
alen = crypto_aead_authsize(aead);
Expand Down Expand Up @@ -176,8 +174,10 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb)
}

tmp = esp_alloc_tmp(aead, nfrags + sglists, seqhilen);
if (!tmp)
if (!tmp) {
err = -ENOMEM;
goto error;
}

seqhi = esp_tmp_seqhi(tmp);
iv = esp_tmp_iv(aead, tmp, seqhilen);
Expand Down

0 comments on commit 06848c1

Please sign in to comment.