All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kyungsik Lee <kyungsik.lee@lge.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: linux-kernel@vger.kernel.org, Matthew Daley <mattjd@gmail.com>,
	akpm@linux-foundation.org, hyojun.im@lge.com, chan.jeong@lge.com
Subject: Re: [PATCH] unlz4: always set an error return code on failures
Date: Mon, 11 Nov 2013 11:49:25 +0900	[thread overview]
Message-ID: <20131111024924.GA23164@hulk> (raw)
In-Reply-To: <527CBC7D020000780010117C@nat28.tlf.novell.com>

Hello Jan,

Thanks for the patch.

On Fri, Nov 08, 2013 at 09:27:09AM +0000, Jan Beulich wrote:
> "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)
>
What do you think of adding "ret2" for keeping "ret" error status
which is set by lz4_decompress*() like below.

{
	int ret2;

	ret2 = lz4_decompress(inp, &chunksize, outp, dest_len);
	if (ret2 < 0) {

	}

Thanks,
Kyungsik


  reply	other threads:[~2013-11-11  2:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08  9:27 [PATCH] unlz4: always set an error return code on failures Jan Beulich
2013-11-11  2:49 ` Kyungsik Lee [this message]
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=20131111024924.GA23164@hulk \
    --to=kyungsik.lee@lge.com \
    --cc=JBeulich@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=chan.jeong@lge.com \
    --cc=hyojun.im@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.