lkml.org 
[lkml]   [2013]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] unlz4: always set an error return code on failures
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


\
 
 \ /
  Last update: 2013-11-11 14:21    [W:0.045 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site