netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Cc: sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com,
	hkelam@marvell.com, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, richardcochran@gmail.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] octeontx2-vf: Add missing free for alloc_percpu
Date: Thu, 16 Mar 2023 21:24:46 -0700	[thread overview]
Message-ID: <20230316212446.44c5a429@kernel.org> (raw)
In-Reply-To: <20230316023911.3615-1-jiasheng@iscas.ac.cn>

On Thu, 16 Mar 2023 10:39:11 +0800 Jiasheng Jiang wrote:
> +	if (vf->hw.lmt_info)
> +		free_percpu(vf->hw.lmt_info);
>  	if (test_bit(CN10K_LMTST, &vf->hw.cap_flag))
>  		qmem_free(vf->dev, vf->dync_lmt);
>  	otx2_detach_resources(&vf->mbox);
> @@ -762,6 +764,8 @@ static void otx2vf_remove(struct pci_dev *pdev)
>  	otx2_shutdown_tc(vf);
>  	otx2vf_disable_mbox_intr(vf);
>  	otx2_detach_resources(&vf->mbox);
> +	if (vf->hw.lmt_info)
> +		free_percpu(vf->hw.lmt_info);

No need for the if () checks, free_percpu() seems to handle NULL just
fine.

      parent reply	other threads:[~2023-03-17  4:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-16  2:39 [PATCH] octeontx2-vf: Add missing free for alloc_percpu Jiasheng Jiang
2023-03-16  8:10 ` Michal Swiatkowski
2023-03-16  9:00   ` [EXT] " Geethasowjanya Akula
2023-03-17  4:24 ` Jakub Kicinski [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=20230316212446.44c5a429@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=jiasheng@iscas.ac.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.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).