Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch '200GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue

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: Jakub Kicinski <kuba@kernel.org>

+21 -3
+19 -3
drivers/net/ethernet/intel/ice/ice_ptp.c
··· 3246 3246 3247 3247 err = ice_ptp_init_port(pf, &ptp->port); 3248 3248 if (err) 3249 - goto err_exit; 3249 + goto err_clean_pf; 3250 3250 3251 3251 /* Start the PHY timestamping block */ 3252 3252 ice_ptp_reset_phy_timestamping(pf); ··· 3263 3263 dev_info(ice_pf_to_dev(pf), "PTP init successful\n"); 3264 3264 return; 3265 3265 3266 + err_clean_pf: 3267 + mutex_destroy(&ptp->port.ps_lock); 3268 + ice_ptp_cleanup_pf(pf); 3266 3269 err_exit: 3267 3270 /* If we registered a PTP clock, release it */ 3268 3271 if (pf->ptp.clock) { 3269 3272 ptp_clock_unregister(ptp->clock); 3270 3273 pf->ptp.clock = NULL; 3271 3274 } 3272 - ptp->state = ICE_PTP_ERROR; 3275 + /* Keep ICE_PTP_UNINIT state to avoid ambiguity at driver unload 3276 + * and to avoid duplicated resources release. 3277 + */ 3278 + ptp->state = ICE_PTP_UNINIT; 3273 3279 dev_err(ice_pf_to_dev(pf), "PTP failed %d\n", err); 3274 3280 } 3275 3281 ··· 3288 3282 */ 3289 3283 void ice_ptp_release(struct ice_pf *pf) 3290 3284 { 3291 - if (pf->ptp.state != ICE_PTP_READY) 3285 + if (pf->ptp.state == ICE_PTP_UNINIT) 3292 3286 return; 3287 + 3288 + if (pf->ptp.state != ICE_PTP_READY) { 3289 + mutex_destroy(&pf->ptp.port.ps_lock); 3290 + ice_ptp_cleanup_pf(pf); 3291 + if (pf->ptp.clock) { 3292 + ptp_clock_unregister(pf->ptp.clock); 3293 + pf->ptp.clock = NULL; 3294 + } 3295 + return; 3296 + } 3293 3297 3294 3298 pf->ptp.state = ICE_PTP_UNINIT; 3295 3299
+2
drivers/net/ethernet/intel/idpf/idpf_main.c
··· 63 63 destroy_workqueue(adapter->vc_event_wq); 64 64 65 65 for (i = 0; i < adapter->max_vports; i++) { 66 + if (!adapter->vport_config[i]) 67 + continue; 66 68 kfree(adapter->vport_config[i]->user_config.q_coalesce); 67 69 kfree(adapter->vport_config[i]); 68 70 adapter->vport_config[i] = NULL;