All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <xiang@kernel.org>
To: Sandeep Dhavale <dhavale@google.com>
Cc: Gao Xiang <hsiangkao@linux.alibaba.com>, linux-erofs@lists.ozlabs.org
Subject: Re: [PATCH 1/3] erofs-utils: fsck: fix fd leak on failure in erofs_extract_file()
Date: Sun, 4 Aug 2024 09:47:44 +0800	[thread overview]
Message-ID: <Zq7dwOGcOQEHOHyW@debian> (raw)
In-Reply-To: <CAB=BE-QZog8YH8DckC5s2T1sU28p4vN60wd86CAeuuSv3XAhOQ@mail.gmail.com>

On Fri, Aug 02, 2024 at 02:17:12PM -0700, Sandeep Dhavale via Linux-erofs wrote:
> Hi Gao,
> 
> On Thu, Aug 1, 2024 at 6:55 PM Gao Xiang <hsiangkao@linux.alibaba.com> wrote:
> >
> > Ignore the return values as other close()s instead.
> >
> > Coverity-id: 502331
> > Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
> > ---
> >  fsck/main.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/fsck/main.c b/fsck/main.c
> > index fb66967..bbef645 100644
> > --- a/fsck/main.c
> > +++ b/fsck/main.c
> > @@ -702,11 +702,9 @@ again:
> >
> >         /* verify data chunk layout */
> >         ret = erofs_verify_inode_data(inode, fd);
> > +       close(fd);
> >         if (ret)
> >                 return ret;
> I think we can get rid of this if block and should be just
> return ret;

Yeah, agreed, let me revise that.

> > -
> > -       if (close(fd))
> > -               return -errno;
> >         return ret;
> >  }
> >
> > --
> > 2.43.5
> >
> You can just do that while applying,
> 
> Reviewed-by: Sandeep Dhavale <dhavale@google.com>
> 

Thanks for your review!

Thanks,
Gao Xiang

> Thanks,
> Sandeep.

      reply	other threads:[~2024-08-04  1:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02  1:55 [PATCH 1/3] erofs-utils: fsck: fix fd leak on failure in erofs_extract_file() Gao Xiang
2024-08-02  1:55 ` [PATCH 2/3] erofs-utils: lib: fix out-of-bounds in erofs_io_xcopy() Gao Xiang
2024-08-02 21:19   ` Sandeep Dhavale via Linux-erofs
2024-08-02  1:55 ` [PATCH 3/3] erofs-utils: lib: fix fd leak on failure in erofs_dev_open() Gao Xiang
2024-08-02 21:21   ` Sandeep Dhavale via Linux-erofs
2024-08-02  6:23 ` [PATCH 4/3] erofs-utils: lib: fix potential memory leak in erofs_export_xattr_ibody() Gao Xiang
2024-08-02 21:22   ` Sandeep Dhavale via Linux-erofs
2024-08-02 21:17 ` [PATCH 1/3] erofs-utils: fsck: fix fd leak on failure in erofs_extract_file() Sandeep Dhavale via Linux-erofs
2024-08-04  1:47   ` Gao Xiang [this message]

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=Zq7dwOGcOQEHOHyW@debian \
    --to=xiang@kernel.org \
    --cc=dhavale@google.com \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    /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.