From: Michael Chan <michael.chan@broadcom•com>
To: davem@davemloft•net
Cc: netdev@vger•kernel.org, kuba@kernel•org, gospo@broadcom•com
Subject: [PATCH net 3/3] bnxt_en: Call bnxt_ethtool_free() in bnxt_init_one() error path
Date: Fri, 18 Jun 2021 02:07:27 -0400 [thread overview]
Message-ID: <1623996447-28958-4-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1623996447-28958-1-git-send-email-michael.chan@broadcom.com>
From: Somnath Kotur <somnath.kotur@broadcom•com>
bnxt_ethtool_init() may have allocated some memory and we need to
call bnxt_ethtool_free() to properly unwind if bnxt_init_one()
fails.
Fixes: 7c3809181468 ("bnxt_en: Refactor bnxt_init_one() and turn on TPA support on 57500 chips.")
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom•com>
Signed-off-by: Michael Chan <michael.chan@broadcom•com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index c913cb1f2a72..aef3fccc27a9 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -13160,6 +13160,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
bnxt_hwrm_func_drv_unrgtr(bp);
bnxt_free_hwrm_short_cmd_req(bp);
bnxt_free_hwrm_resources(bp);
+ bnxt_ethtool_free(bp);
kfree(bp->fw_health);
bp->fw_health = NULL;
bnxt_cleanup_pci(bp);
--
2.18.1
next prev parent reply other threads:[~2021-06-18 6:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-18 6:07 [PATCH net 0/3] bnxt_en: Bug fixes Michael Chan
2021-06-18 6:07 ` [PATCH net 1/3] bnxt_en: Rediscover PHY capabilities after firmware reset Michael Chan
2021-06-18 6:07 ` [PATCH net 2/3] bnxt_en: Fix TQM fastpath ring backing store computation Michael Chan
2021-06-18 6:07 ` Michael Chan [this message]
2021-06-18 19:10 ` [PATCH net 0/3] bnxt_en: Bug fixes patchwork-bot+netdevbpf
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=1623996447-28958-4-git-send-email-michael.chan@broadcom.com \
--to=michael.chan@broadcom$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=gospo@broadcom$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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