Commit f170b1dc authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files
Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2025-11-18 (idpf, ice)

This series contains updates to idpf and ice drivers.

Emil adds a check for NULL vport_config during removal to avoid NULL
pointer dereference in idpf.

Grzegorz fixes PTP teardown paths to account for some missed cleanups
for ice driver.

* '200GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue:
  ice: fix PTP cleanup on driver removal in error path
  idpf: fix possible vport_config NULL pointer deref in remove
====================

Link: https://patch.msgid.link/20251118235207.2165495-1-anthony.l.nguyen@intel.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 4026310a 23a5b9b1
Loading
Loading
Loading
Loading
+19 −3
Original line number Diff line number Diff line
@@ -3246,7 +3246,7 @@ void ice_ptp_init(struct ice_pf *pf)

	err = ice_ptp_init_port(pf, &ptp->port);
	if (err)
		goto err_exit;
		goto err_clean_pf;

	/* Start the PHY timestamping block */
	ice_ptp_reset_phy_timestamping(pf);
@@ -3263,13 +3263,19 @@ void ice_ptp_init(struct ice_pf *pf)
	dev_info(ice_pf_to_dev(pf), "PTP init successful\n");
	return;

err_clean_pf:
	mutex_destroy(&ptp->port.ps_lock);
	ice_ptp_cleanup_pf(pf);
err_exit:
	/* If we registered a PTP clock, release it */
	if (pf->ptp.clock) {
		ptp_clock_unregister(ptp->clock);
		pf->ptp.clock = NULL;
	}
	ptp->state = ICE_PTP_ERROR;
	/* Keep ICE_PTP_UNINIT state to avoid ambiguity at driver unload
	 * and to avoid duplicated resources release.
	 */
	ptp->state = ICE_PTP_UNINIT;
	dev_err(ice_pf_to_dev(pf), "PTP failed %d\n", err);
}

@@ -3282,8 +3288,18 @@ void ice_ptp_init(struct ice_pf *pf)
 */
void ice_ptp_release(struct ice_pf *pf)
{
	if (pf->ptp.state != ICE_PTP_READY)
	if (pf->ptp.state == ICE_PTP_UNINIT)
		return;

	if (pf->ptp.state != ICE_PTP_READY) {
		mutex_destroy(&pf->ptp.port.ps_lock);
		ice_ptp_cleanup_pf(pf);
		if (pf->ptp.clock) {
			ptp_clock_unregister(pf->ptp.clock);
			pf->ptp.clock = NULL;
		}
		return;
	}

	pf->ptp.state = ICE_PTP_UNINIT;

+2 −0
Original line number Diff line number Diff line
@@ -63,6 +63,8 @@ static void idpf_remove(struct pci_dev *pdev)
	destroy_workqueue(adapter->vc_event_wq);

	for (i = 0; i < adapter->max_vports; i++) {
		if (!adapter->vport_config[i])
			continue;
		kfree(adapter->vport_config[i]->user_config.q_coalesce);
		kfree(adapter->vport_config[i]);
		adapter->vport_config[i] = NULL;