mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: <linux-kernel@vger.kernel.org>
Cc: "Matthew Daley" <mattjd@gmail.com>, <kyungsik.lee@lge.com>,
	<akpm@linux-foundation.org>
Subject: [PATCH] unlz4: always set an error return code on failures
Date: Fri, 08 Nov 2013 09:27:09 +0000	[thread overview]
Message-ID: <527CBC7D020000780010117C@nat28.tlf.novell.com> (raw)

"ret", being set to -1 early on, gets cleared by the first invocation
of lz4_decompress()/lz4_decompress_unknownoutputsize(), and hence
subsequent failures wouldn't be noticed by the caller without setting
it back to -1 right after those calls.

Reported-by: Matthew Daley <mattjd@gmail.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Kyungsik Lee <kyungsik.lee@lge.com>
Cc: Andrew Morton <akpm@linux-foundation.org>

--- a/lib/decompress_unlz4.c
+++ b/lib/decompress_unlz4.c
@@ -141,6 +141,7 @@ STATIC inline int INIT unlz4(u8 *input, 
 			goto exit_2;
 		}
 
+		ret = -1;
 		if (flush && flush(outp, dest_len) != dest_len)
 			goto exit_2;
 		if (output)




             reply	other threads:[~2013-11-08  9:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08  9:27 Jan Beulich [this message]
2013-11-11  2:49 ` Kyungsik Lee
2013-11-11  8:35   ` Jan Beulich
2013-11-11 13:02     ` Kyungsik Lee
2013-11-11 13:33       ` Jan Beulich

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=527CBC7D020000780010117C@nat28.tlf.novell.com \
    --to=jbeulich@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=kyungsik.lee@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mattjd@gmail.com \
    /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®