From: Joe Damato <joe@dama.to>
To: Changyul Lee <lcy8047@gmail.com>
Cc: Michael Chan <michael.chan@broadcom.com>,
Pavan Chebbi <pavan.chebbi@broadcom.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Vikas Gupta <vikas.gupta@broadcom.com>,
Andy Gospodarek <andrew.gospodarek@broadcom.com>,
Jacob Keller <jacob.e.keller@intel.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] bnxt_en: Fix auxiliary device leak on early probe failures
Date: Wed, 18 Nov 2026 09:23:48 -0800 [thread overview]
Message-ID: <av3fJLQd8P+XlOS/@devvm20253.cco0.facebook.com> (raw)
In-Reply-To: <20261118050716.3873167-1-lcy8047@gmail.com>
On Wed, Nov 18, 2026 at 12:07:16AM -0500, Changyul Lee wrote:
> bnxt_init_one() allocates the auxiliary device ID and initializes the
> auxiliary devices before bnxt_set_dflt_rings(). If that call,
> bnxt_init_int_mode() or the bnxt_pf_wq allocation fails, probe jumps to
> init_err_pci_clean, which does not uninitialize the devices or free the
> ID. Only init_err_cleanup does. The devices are never released, so their
> aux_priv, edev and ulp_tbl allocations and the ID in bnxt_aux_dev_ids are
> leaked once free_netdev() frees bp. A VF probed while the PF is down
> fails this way each time.
>
> Add an init_err_auxdev label for this cleanup and use it for every
> failure after the devices are initialized. On the register_netdev()
> failure path the cleanup now runs after bnxt_clear_int_mode(), in the
> reverse order of setup.
>
> Fixes: 2e4592dc9bee ("bnxt_en: Change MSIX/NQs allocation policy")
> Signed-off-by: Changyul Lee <lcy8047@gmail.com>
> ---
> Found with a static analysis tool we are developing.
>
> Compile-tested only, with x86_64_defconfig plus BNXT and W=1.
>
> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
Reviewed-by: Joe Damato <joe@dama.to>
prev parent reply other threads:[~2026-11-18 17:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 5:07 Changyul Lee
2026-11-18 17:23 ` Joe Damato [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=av3fJLQd8P+XlOS/@devvm20253.cco0.facebook.com \
--to=joe@dama.to \
--cc=andrew+netdev@lunn.ch \
--cc=andrew.gospodarek@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--cc=lcy8047@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=vikas.gupta@broadcom.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
all inboxes | Powered by JetHome®