linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Raju Rangoju <rajur@chelsio.com>
To: Yang Li <abaci-bugfix@linux.alibaba.com>
Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] cxgb4: remove redundant NULL check
Date: Wed, 27 Jan 2021 09:35:47 +0530	[thread overview]
Message-ID: <20210127040545.GB21071@chelsio.com> (raw)
In-Reply-To: <1611568045-121839-3-git-send-email-abaci-bugfix@linux.alibaba.com>

On Monday, January 01/25/21, 2021 at 17:47:24 +0800, Yang Li wrote:
> Fix below warnings reported by coccicheck:
> ./drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c:161:2-7: 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>
> ---
>  drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c
> index 77648e4..dd66b24 100644
> --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c
> +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c
> @@ -157,8 +157,7 @@ static int cudbg_alloc_compress_buff(struct cudbg_init *pdbg_init)
>  
>  static void cudbg_free_compress_buff(struct cudbg_init *pdbg_init)
>  {
> -	if (pdbg_init->compress_buff)

NAK. The above check is necessary.

pdbg_init->compress_buff may be NULL when Zlib is unavailable or when
pdbg_init->compress_buff allocation fails, in which case we ignore error
and continue without compression.

> -		vfree(pdbg_init->compress_buff);
> +	vfree(pdbg_init->compress_buff);
>  }
>  
>  int cxgb4_cudbg_collect(struct adapter *adap, void *buf, u32 *buf_size,
> -- 
> 1.8.3.1
> 

  reply	other threads:[~2021-01-27  4:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25  9:47 [PATCH 1/4] cxgb4: remove redundant NULL check Yang Li
2021-01-25  9:47 ` [PATCH 2/4] " Yang Li
2021-01-25  9:47 ` [PATCH 3/4] " Yang Li
2021-01-27  4:05   ` Raju Rangoju [this message]
2021-01-25  9:47 ` [PATCH 4/4] " Yang Li
2021-01-27  3:56   ` Raju Rangoju
2021-01-25 21:14 ` [PATCH 1/4] " Jakub Kicinski

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=20210127040545.GB21071@chelsio.com \
    --to=rajur@chelsio.com \
    --cc=abaci-bugfix@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@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).