mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
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>
This commit is contained in:
@@ -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,9 +3288,19 @@ err_exit:
|
||||
*/
|
||||
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;
|
||||
|
||||
/* Disable timestamping for both Tx and Rx */
|
||||
|
||||
@@ -63,6 +63,8 @@ destroy_wqs:
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user