Re: [PATCH net v2] bnxt_en: Fix NULL pointer crash in bnxt_ptp_enable during error cleanup
From: Breno Leitao
Date: Tue Jan 06 2026 - 06:33:33 EST
On Mon, Jan 05, 2026 at 04:04:58PM -0800, Jakub Kicinski wrote:
> 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.
no reason, just a mistake. I will update.