]> git.baikalelectronics.ru Git - kernel.git/commitdiff
bnxt_en: Call bnxt_ethtool_free() in bnxt_init_one() error path
authorSomnath Kotur <somnath.kotur@broadcom.com>
Fri, 18 Jun 2021 06:07:27 +0000 (02:07 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Jun 2021 19:00:27 +0000 (12:00 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index c913cb1f2a720b20d05dc2d5ea81ef3de2d87cbf..aef3fccc27a97517378f1e2a0eb2c7ee1e335dd8 100644 (file)
@@ -13160,6 +13160,7 @@ init_err_pci_clean:
        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);