From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, andrew+netdev@lunn.ch,
pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com
Subject: [PATCH net-next v3 2/7] bnxt_en: Fix bnxt_reinit_features() when irq_re_init is true
Date: Mon, 12 Oct 2026 15:08:22 -0700 [thread overview]
Message-ID: <20261012220827.340998-3-michael.chan@broadcom.com> (raw)
In-Reply-To: <20261012220827.340998-1-michael.chan@broadcom.com>
bnxt_set_features() takes a snapshot of bp->flags, closes the device,
and then blindly restores the entire bp->flags. bp->flags contains
statistics flags that may be cleared and the memory freed when
irq_re_init is true. Do not restore these statistics flags until
bnxt_open_nic() reallocates the memory. bnxt_open_nic() can
potentially fail to allocate the stats memory and the restored flags
can potentially cause NULL dereference of the stats memory.
Fixes: 93e90104bd12 ("bnxt_en: Create and setup the additional VNIC for adding ntuple filters")
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 2bd2c039ce43..d23b40b0cb92 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -14090,7 +14090,8 @@ static int bnxt_reinit_features(struct bnxt *bp, bool irq_re_init,
bool link_re_init, u32 flags, bool update_tpa)
{
bnxt_close_nic(bp, irq_re_init, link_re_init);
- bp->flags = flags;
+ bp->flags = (bp->flags & ~BNXT_FLAG_ALL_CONFIG_FEATS) |
+ (flags & BNXT_FLAG_ALL_CONFIG_FEATS);
if (update_tpa)
bnxt_set_ring_params(bp);
return bnxt_open_nic(bp, irq_re_init, link_re_init);
--
2.51.0
next prev parent reply other threads:[~2026-10-12 22:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 22:08 [PATCH net-next v3 0/7] bnxt_en: Ring accounting fixes Michael Chan
2026-10-12 22:08 ` [PATCH net-next v3 1/7] bnxt_en: Clear bp->total_irqs in bnxt_init_int_mode() during error Michael Chan
2026-10-12 22:08 ` Michael Chan [this message]
2026-10-12 22:08 ` [PATCH net-next v3 3/7] bnxt_en: Refactor RSS table check logic Michael Chan
2026-10-13 0:23 ` Joe Damato
2026-10-12 22:08 ` [PATCH net-next v3 4/7] bnxt_en: Refactor IRQs required logic Michael Chan
2026-10-13 0:25 ` Joe Damato
2026-10-12 22:08 ` [PATCH net-next v3 5/7] bnxt_en: Reinit IRQ when configuring LRO/GRO/HDS Michael Chan
2026-10-12 22:08 ` [PATCH net-next v3 6/7] bnxt_en: Remove support for the old NITRO A0 chip Michael Chan
2026-10-13 0:35 ` Joe Damato
2026-10-12 22:08 ` [PATCH net-next v3 7/7] bnxt_en: Fix ring accounting and validation when rings are constrained Michael Chan
2026-10-12 22:15 ` [PATCH net-next v3 0/7] bnxt_en: Ring accounting fixes netdev-bot+sinfo
2026-10-12 22:52 ` Michael Chan
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=20261012220827.340998-3-michael.chan@broadcom.com \
--to=michael.chan@broadcom.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew.gospodarek@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@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 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.