All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: <netdev@vger.kernel.org>, <aelior@marvell.com>,
	<skalluru@marvell.com>, <manishc@marvell.com>,
	Joe Perches <joe@perches.com>
Subject: Re: [PATCH net] bnx2x: fix pci device refcount leak in bnx2x_vf_is_pcie_pending()
Date: Fri, 18 Nov 2022 18:52:52 -0800	[thread overview]
Message-ID: <20221118185252.52f96466@kernel.org> (raw)
In-Reply-To: <20221117123301.42916-1-yangyingliang@huawei.com>

On Thu, 17 Nov 2022 20:33:01 +0800 Yang Yingliang wrote:
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> index 11d15cd03600..cd5108b38542 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> @@ -802,8 +802,11 @@ static u8 bnx2x_vf_is_pcie_pending(struct bnx2x *bp, u8 abs_vfid)
>  		return false;
>  
>  	dev = pci_get_domain_bus_and_slot(vf->domain, vf->bus, vf->devfn);
> -	if (dev)
> -		return bnx2x_is_pcie_pending(dev);
> +	if (dev) {
> +		bool pending = bnx2x_is_pcie_pending(dev);
> +		pci_dev_put(dev);
> +		return pending;
> +	}
>  	return false;

Success path should be unindented:

	dev = pci_get..
	if (!dev)
		return false;
	pending = bnxt2x_is_...
	pci_dev_put(dev);

	return pending;

Please use get_maintainers on the formatted patch file to find all 
the people to CC.

      reply	other threads:[~2022-11-19  2:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17 12:33 [PATCH net] bnx2x: fix pci device refcount leak in bnx2x_vf_is_pcie_pending() Yang Yingliang
2022-11-19  2:52 ` 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=20221118185252.52f96466@kernel.org \
    --to=kuba@kernel.org \
    --cc=aelior@marvell.com \
    --cc=joe@perches.com \
    --cc=manishc@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=skalluru@marvell.com \
    --cc=yangyingliang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.