linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Yang Li <abaci-bugfix@linux.alibaba.com>, clm@fb.com
Cc: josef@toxicpanda.com, dsterba@suse.com,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs: remove redundant NULL check
Date: Thu, 21 Jan 2021 18:29:38 +0800	[thread overview]
Message-ID: <583d9738-dcde-6e7f-d995-5d8b70ce96c1@oracle.com> (raw)
In-Reply-To: <1611217187-50142-1-git-send-email-abaci-bugfix@linux.alibaba.com>

On 21/1/21 4:19 pm, Yang Li wrote:
> Fix below warnings reported by coccicheck:
> ./fs/btrfs/raid56.c:237:2-8: WARNING: NULL check before some freeing
> functions is not needed.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <abaci-bugfix@linux.alibaba.com>
> ---
>   fs/btrfs/raid56.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
> index 93fbf87..5394641 100644
> --- a/fs/btrfs/raid56.c
> +++ b/fs/btrfs/raid56.c
> @@ -233,8 +233,7 @@ int btrfs_alloc_stripe_hash_table(struct btrfs_fs_info *info)
>   	}
>   
>   	x = cmpxchg(&info->stripe_hash_table, NULL, table);
> -	if (x)
> -		kvfree(x);
> +	kvfree(x);



  Reviewed-by: Anand Jain <anand.jain@oracle.com>

Thanks, Anand


>   	return 0;
>   }
>   
> 


  reply	other threads:[~2021-01-21 10:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21  8:19 [PATCH] btrfs: remove redundant NULL check Yang Li
2021-01-21 10:29 ` Anand Jain [this message]
2021-01-21 16:35 ` David Sterba

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=583d9738-dcde-6e7f-d995-5d8b70ce96c1@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=abaci-bugfix@linux.alibaba.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 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).