]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bnxt_en: fix module unload sequence
authorVadim Fedorenko <vadfed@meta.com>
Wed, 30 Apr 2025 17:03:43 +0000 (10:03 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 1 May 2025 13:58:20 +0000 (06:58 -0700)
Recent updates to the PTP part of bnxt changed the way PTP FIFO is
cleared, skbs waiting for TX timestamps are now cleared during
ndo_close() call. To do clearing procedure, the ptp structure must
exist and point to a valid address. Module destroy sequence had ptp
clear code running before netdev close causing invalid memory access and
kernel crash. Change the sequence to destroy ptp structure after device
close.

Fixes: 8f7ae5a85137 ("bnxt_en: improve TX timestamping FIFO configuration")
Reported-by: Taehee Yoo <ap420073@gmail.com>
Closes: https://lore.kernel.org/netdev/CAMArcTWDe2cd41=ub=zzvYifaYcYv-N-csxfqxUvejy_L0D6UQ@mail.gmail.com/
Signed-off-by: Vadim Fedorenko <vadfed@meta.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Tested-by: Taehee Yoo <ap420073@gmail.com>
Link: https://patch.msgid.link/20250430170343.759126-1-vadfed@meta.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 78e496b0ec2625a8086d05e69a647d1345d5fff3..86a5de44b6f3fe4afc4a1885f6ee21249cd5a4cf 100644 (file)
@@ -16006,8 +16006,8 @@ static void bnxt_remove_one(struct pci_dev *pdev)
 
        bnxt_rdma_aux_device_del(bp);
 
-       bnxt_ptp_clear(bp);
        unregister_netdev(dev);
+       bnxt_ptp_clear(bp);
 
        bnxt_rdma_aux_device_uninit(bp);