]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
bnxt_en: Free context memory after disabling PCI in probe error path.
authorMichael Chan <michael.chan@broadcom.com>
Sun, 22 Mar 2020 20:40:04 +0000 (16:40 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 3 Apr 2020 13:17:23 +0000 (15:17 +0200)
BugLink: https://bugs.launchpad.net/bugs/1870142
[ Upstream commit 62bfb932a51f6d08eb409248e69f8d6428c2cabd ]

Other shutdown code paths will always disable PCI first to shutdown DMA
before freeing context memory.  Do the same sequence in the error path
of probe to be safe and consistent.

Fixes: c20dc142dd7b ("bnxt_en: Disable bus master during PCI shutdown and driver unload.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index ff6694ca0d3fa6729d1c019ff1a1ebdf5c5ee1ac..ae5416e84b88693c9ba2ffea41feb147c1d51bc3 100644 (file)
@@ -11895,12 +11895,12 @@ init_err_cleanup:
 init_err_pci_clean:
        bnxt_free_hwrm_short_cmd_req(bp);
        bnxt_free_hwrm_resources(bp);
-       bnxt_free_ctx_mem(bp);
-       kfree(bp->ctx);
-       bp->ctx = NULL;
        kfree(bp->fw_health);
        bp->fw_health = NULL;
        bnxt_cleanup_pci(bp);
+       bnxt_free_ctx_mem(bp);
+       kfree(bp->ctx);
+       bp->ctx = NULL;
 
 init_err_free:
        free_netdev(dev);