[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHc6FU6g5k5-D8E5HjS99TLhRRXDG8xuDYT4JX3Pp=HqY+b9cw@mail.gmail.com>
Date: Thu, 17 Apr 2025 15:39:46 +0200
From: Andreas Gruenbacher <agruenba@...hat.com>
To: Chen Ni <nichen@...as.ac.cn>
Cc: gfs2@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gfs2: Remove unnecessary NULL check before free_percpu()
On Thu, Apr 17, 2025 at 10:45 AM Chen Ni <nichen@...as.ac.cn> wrote:
> free_percpu() checks for NULL pointers internally.
> Remove unneeded NULL check here.
>
> Signed-off-by: Chen Ni <nichen@...as.ac.cn>
> ---
> fs/gfs2/ops_fstype.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
> index ea5b3c5c6e1c..8f9bb6677db7 100644
> --- a/fs/gfs2/ops_fstype.c
> +++ b/fs/gfs2/ops_fstype.c
> @@ -64,8 +64,7 @@ static void gfs2_tune_init(struct gfs2_tune *gt)
>
> void free_sbd(struct gfs2_sbd *sdp)
> {
> - if (sdp->sd_lkstats)
> - free_percpu(sdp->sd_lkstats);
> + free_percpu(sdp->sd_lkstats);
> kfree(sdp);
> }
>
> --
> 2.25.1
>
Applied, thanks.
Andreas
Powered by blists - more mailing lists