mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonghwan Choi <jhbird.choi@samsung.com>
To: "'Jonghwan Choi'" <jhbird.choi@samsung.com>,
	linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org,
	"'Wei Yongjun'" <yongjun_wei@trendmicro.com.cn>,
	"'David S. Miller'" <davem@davemloft.net>
Subject: [PATCH 3.8-stable] esp4: fix error return code in esp_output()
Date: Thu, 18 Apr 2013 07:33:19 +0900	[thread overview]
Message-ID: <003301ce3bbb$8fd1fd70$af75f850$%choi@samsung.com> (raw)
In-Reply-To: 

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

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

From: "Wei Yongjun <yongjun_wei@trendmicro.com.cn>"

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: Jonghwan Choi <jhbird.choi@samsung.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 3b4f0cd..4cfe34d 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);
--
1.7.9.5


             reply	other threads:[~2013-04-17 22:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-17 22:33 Jonghwan Choi [this message]
2013-04-17 22:37 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='003301ce3bbb$8fd1fd70$af75f850$%choi@samsung.com' \
    --to=jhbird.choi@samsung.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yongjun_wei@trendmicro.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®