Resolve multiple issues in the error path during reset handling of the IDPF driver: - Mailbox timeouts in the init task during a reset lead to the netdevs being unregistered. - Reset times out and leaves the netdevs exposed to callbacks with the vport resources already freed. - Simultaneous reset and soft reset calls will result in the loss of the vport state, leaving the netdev in DOWN state. - Memory leak in idpf_vport_rel() where vport->rx_ptype_lkup was not freed during a reset. - Memory leak in idpf_vc_core_deinit(), where kfree() was missing for hw->lan_regs. - Crash on reset following a failed init on load, due to the service tasks still running in the background and attempting to handle the reset while resources are not initialized.
Changelog: v2: - Patch 1 - No change. - Patch 2 - Changed the check for vport being NULL by accessing it via the adapter struct instead of idpf_netdev_priv. This avoids potential NULL pointer in the case where the init task failed on driver load. Updated comments to clarify vports can be NULL before the call to idpf_attach_and_open(). - Patch 3 - No change. - Patch 4 - No change. - Patch 5 - New to the series, to fix a crash, following a failed driver load due to an error in the init task. v1: https://lore.kernel.org/intel-wired-lan/[email protected]/ Emil Tantilov (5): idpf: keep the netdev when a reset fails idpf: detach and close netdevs while handling a reset idpf: fix memory leak in idpf_vport_rel() idpf: fix memory leak in idpf_vc_core_deinit() idpf: fix error handling in the init_task on load drivers/net/ethernet/intel/idpf/idpf_lib.c | 156 +++++++++++------- .../net/ethernet/intel/idpf/idpf_virtchnl.c | 4 + 2 files changed, 96 insertions(+), 64 deletions(-) -- 2.37.3
