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

On Mon, Nov 11, 2013 at 08:35:31AM +0000, Jan Beulich wrote:
> >>> On 11.11.13 at 03:49, Kyungsik Lee <kyungsik.lee@lge.com> wrote:
> > 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.
> 
> I'd be fine with that too, but preferred to submit the smallest
> possible (read: one line) patch in this case.
>
I think it looks neat avoiding "ret" being set to error status
in the loop. Can you please resend the patch with those changes?

Acked-by: Kyungsik Lee <kyungsik.lee@lge.com>

Thanks,
Kyungsik

  reply	other threads:[~2013-11-11 13:02 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
2013-11-11  8:35   ` Jan Beulich
2013-11-11 13:02     ` Kyungsik Lee [this message]
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=20131111130227.GA31739@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.