Skip to contentSkip to conversation

esp4: fix error return code in esp_output()

PATCH In review Jonghwan Choi 2 participants 2 messages Apr 17, 2013 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 esp4: fix error return code in esp_output()

This patch looks like it should be in the 3.8-stable tree, should we apply it?

------------------

From: "Wei Yongjun <[email protected]>"

commit 06848c10f720cbc20e3b784c0df24930b7304b93 upstream

Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function.

---
 net/ipv4/esp4.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
net/ipv4/esp4.c +0 -0
index 3b4f0cd..4cfe34d 100644
@@ -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);
@@ -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);

--
1.7.9.5