[3.5.y.z,extended,stable] Patch "esp4: fix error return code in esp_output()" has been added to staging queue

Message ID 1367451302-20336-1-git-send-email-luis.henriques@canonical.com
State New
Headers show

Commit Message

Luis Henriques May 1, 2013, 11:35 p.m.
This is a note to let you know that I have just added a patch titled

    esp4: fix error return code in esp_output()

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:


If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see



From 7ba4b3466cbe07ac8c84aa12b98eccbb0886523b Mon Sep 17 00:00:00 2001
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Date: Sat, 13 Apr 2013 15:49:03 +0000
Subject: [PATCH] esp4: fix error return code in esp_output()

commit 06848c10f720cbc20e3b784c0df24930b7304b93 upstream.

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>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
 net/ipv4/esp4.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)



diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index cb982a6..e814e2a 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -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);