cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruenba@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] gfs2: Remove redundant NULL check before kfree
Date: Thu, 2 Jun 2022 09:57:32 +0200	[thread overview]
Message-ID: <CAHc6FU6hiOHS-b7Ft0AwL+aOZwwgE6WjiJuN1ZRi2k2aH6Si8Q@mail.gmail.com> (raw)
In-Reply-To: <20220602071939.278344-1-chi.minghao@zte.com.cn>

On Thu, Jun 2, 2022 at 9:19 AM <cgel.zte@gmail.com> wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
>
> kfree on NULL pointer is a no-op.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
>  fs/gfs2/file.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
> index 2cceb193dcd8..d8f1239344c1 100644
> --- a/fs/gfs2/file.c
> +++ b/fs/gfs2/file.c
> @@ -1066,8 +1066,7 @@ static ssize_t gfs2_file_buffered_write(struct kiocb *iocb,
>                 gfs2_glock_dq(gh);
>  out_uninit:
>         gfs2_holder_uninit(gh);
> -       if (statfs_gh)
> -               kfree(statfs_gh);
> +       kfree(statfs_gh);
>         from->count = orig_count - written;
>         return written ? written : ret;
>  }
> --
> 2.25.1
>

Added to for-next, thanks.

Andreas


      reply	other threads:[~2022-06-02  7:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02  7:19 [Cluster-devel] [PATCH] gfs2: Remove redundant NULL check before kfree cgel.zte
2022-06-02  7:57 ` Andreas Gruenbacher [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=CAHc6FU6hiOHS-b7Ft0AwL+aOZwwgE6WjiJuN1ZRi2k2aH6Si8Q@mail.gmail.com \
    --to=agruenba@redhat.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;
as well as URLs for NNTP newsgroup(s).