Re: [PATCH net v2] bnxt_en: Fix NULL pointer crash in bnxt_ptp_enable during error cleanup

From: Jakub Kicinski

Date: Mon Jan 05 2026 - 19:05:16 EST


On Mon, 05 Jan 2026 04:00:16 -0800 Breno Leitao wrote:
> init_err_pci_clean:
> bnxt_hwrm_func_drv_unrgtr(bp);
> + bnxt_ptp_clear(bp);
> + kfree(bp->ptp_cfg);
> bnxt_free_hwrm_resources(bp);
> bnxt_hwmon_uninit(bp);
> bnxt_ethtool_free(bp);
> - bnxt_ptp_clear(bp);
> - kfree(bp->ptp_cfg);
> bp->ptp_cfg = NULL;

Is there a reason to leave clearing of the pointer behind?
I don't see it mentioned in the commit msg..
Checking previous discussion it sounds like Pavan asked for the
clearing to also be moved.

> kfree(bp->fw_health);
> bp->fw_health = NULL;