netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Manlunas <felix.manlunas@cavium.com>
To: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: Derek Chickles <derek.chickles@caviumnetworks.com>,
	Satanand Burla <satananda.burla@caviumnetworks.com>,
	Felix Manlunas <felix.manlunas@caviumnetworks.com>,
	Raghu Vatsavayi <raghu.vatsavayi@caviumnetworks.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] liquidio: remove unnecessary NULL check before kfree in delete_glists
Date: Wed, 18 Oct 2017 10:47:29 -0700	[thread overview]
Message-ID: <20171018174729.GA14189@felix-thinkpad.cavium.com> (raw)
In-Reply-To: <20171017185920.GA16976@embeddedor.com>

On Tue, Oct 17, 2017 at 01:59:20PM -0500, Gustavo A. R. Silva wrote:
> NULL check before freeing functions like kfree is not needed.
> 
> This issue was detected with the help of Coccinelle.
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
> This code was tested by compilation only.
> 
>  drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
> index 2e993ce..e4a112c 100644
> --- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
> +++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
> @@ -435,8 +435,7 @@ static void delete_glists(struct lio *lio)
>  		do {
>  			g = (struct octnic_gather *)
>  			    list_delete_head(&lio->glist[i]);
> -			if (g)
> -				kfree(g);
> +			kfree(g);
>  		} while (g);
>  
>  		if (lio->glists_virt_base && lio->glists_virt_base[i] &&
> -- 
> 2.7.4
> 

Acked-by: Felix Manlunas <felix.manlunas@cavium.com>

  parent reply	other threads:[~2017-10-18 17:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17 18:59 [PATCH 1/2] liquidio: remove unnecessary NULL check before kfree in delete_glists Gustavo A. R. Silva
2017-10-17 19:01 ` [PATCH 2/2] liquidio: mark expected switch fall-through in octeon_destroy_resources Gustavo A. R. Silva
2017-10-18 17:53   ` Felix Manlunas
2017-10-19 12:28   ` David Miller
2017-10-18 17:47 ` Felix Manlunas [this message]
2017-10-19 12:28 ` [PATCH 1/2] liquidio: remove unnecessary NULL check before kfree in delete_glists David Miller

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=20171018174729.GA14189@felix-thinkpad.cavium.com \
    --to=felix.manlunas@cavium.com \
    --cc=derek.chickles@caviumnetworks.com \
    --cc=felix.manlunas@caviumnetworks.com \
    --cc=garsilva@embeddedor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=raghu.vatsavayi@caviumnetworks.com \
    --cc=satananda.burla@caviumnetworks.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).