Skip to contentSkip to conversation

idpf: cancel mailbox work in error path

PATCH Superseded Pavan Kumar Linga 2 participants 3 messages Oct 4, 2023 – Oct 5, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 idpf: cancel mailbox work in error path

In idpf_vc_core_init, the mailbox work is queued on a mailbox workqueue but it is not cancelled on error. This results in a call trace when idpf_mbx_task tries to access the freed mailbox queue pointer. Fix it by cancelling the mailbox work in the error path.

---
 drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +1 -0
index 9bc85b2f1709..cbb3f104f899 100644
@@ -3140,6 +3140,7 @@ int idpf_vc_core_init(struct idpf_adapter *adapter)
 
 err_intr_req:
 	cancel_delayed_work_sync(&adapter->serv_task);
+	cancel_delayed_work_sync(&adapter->mbx_task);
 	idpf_vport_params_buf_rel(adapter);
 err_netdev_alloc:
 	kfree(adapter->vports);
Signature · 6 lines
2.38.1

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
maintainer
#1 lore raw
Quoted 5 lines · Pavan Kumar Linga

In idpf_vc_core_init, the mailbox work is queued on a mailbox workqueue but it is not cancelled on error. This results in a call trace when idpf_mbx_task tries to access the freed mailbox queue pointer. Fix it by cancelling the mailbox work in the error path.

Seems like this is a bug fix; it should still have a Fixes: even if it's going to -next.

Quoted 11 lines
---
  drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 1 +
  1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +0 -0
index 9bc85b2f1709..cbb3f104f899 100644

drivers/net/ethernet/intel/idpf/idpf_virtchnl.c int idpf_vc_core_init(struct idpf_adapter *adapter) · line 3146

Quoted 7 lines
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +1 -0
@@ -3140,6 +3140,7 @@ int idpf_vc_core_init(struct idpf_adapter *adapter)
 
  err_intr_req:
  	cancel_delayed_work_sync(&adapter->serv_task);
+	cancel_delayed_work_sync(&adapter->mbx_task);
  	idpf_vport_params_buf_rel(adapter);
  err_netdev_alloc:
  	kfree(adapter->vports);

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#2 lore raw
Quoted 11 lines · Tony Nguyen
Quoted 5 lines · Pavan Kumar Linga

In idpf_vc_core_init, the mailbox work is queued on a mailbox workqueue but it is not cancelled on error. This results in a call trace when idpf_mbx_task tries to access the freed mailbox queue pointer. Fix it by cancelling the mailbox work in the error path.

Seems like this is a bug fix; it should still have a Fixes: even if it's going to -next.

Fixed it in v2.

Thanks,
Pavan

Quoted 6 lines
Quoted 6 lines

---
  drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 1 +

  1 file changed, 1 insertion(+)
Quoted 11 lines
Quoted 11 lines
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +0 -0
index 9bc85b2f1709..cbb3f104f899 100644
@@ -3140,6 +3140,7 @@ int idpf_vc_core_init(struct idpf_adapter *adapter)

  err_intr_req:
      cancel_delayed_work_sync(&adapter->serv_task); +    cancel_delayed_work_sync(&adapter->mbx_task); idpf_vport_params_buf_rel(adapter); err_netdev_alloc:
      kfree(adapter->vports);

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan