i40e: Fix error handling code of label err_set_queues
Subsystems (3)
PATCH 1/1 i40e: Fix error handling code of label err_set_queues
If i40e_up_complete fails in i40e_vsi_open, it goes to err_up_complete. The label err_set_queues has an issue: if the else branch is executed, there is no need to execute i40e_vsi_request_irq.
Fix this by adding a condition of i40e_vsi_free_irq.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -1
@@ -8720,7 +8720,8 @@ int i40e_vsi_open(struct i40e_vsi *vsi) err_up_complete:i40e_down (vsi); err_set_queues: -i40e_vsi_free_irq (vsi); +if ((vsi->netdev) || (vsi->type ==I40E_VSI_FDIR )) +i40e_vsi_free_irq (vsi); err_setup_rx:i40e_vsi_free_rx_resources (vsi); err_setup_tx:
Signature · 1 line
2.25.1
Quoted 3 lines · Dongliang Mu
If
i40e_up_completefails ini40e_vsi_open, it goes toerr_up_complete. The labelerr_set_queueshas an issue: if the else branch is executed, there is no need to executei40e_vsi_request_irq.
This is unnecessary: if the else branch is executed then control will goto err_setup_rx, skipping over i40e_up_complete().
sln
Quoted 25 lines
Fix this by adding a condition of
i40e_vsi_free_irq.Reported-by Dongliang Mu (mudongliangabcd at gmail.com)Fixes 9c04cfcd4aad ("i40e: Fix error handling in i40e_vsi_open")Fixes c22e3c6c7912 ("i40e: prep vsi_open logic for non-netdev cases")Signed-off-by Dongliang Mu <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/intel/i40e/i40e_main.c +2
-1@@ -8720,7 +8720,8 @@ int i40e_vsi_open(struct i40e_vsi *vsi) err_up_complete:i40e_down (vsi); err_set_queues: -i40e_vsi_free_irq (vsi); +if ((vsi->netdev) || (vsi->type ==I40E_VSI_FDIR )) +i40e_vsi_free_irq (vsi); err_setup_rx:i40e_vsi_free_rx_resources (vsi); err_setup_tx:
Quoted 8 lines · Shannon Nelson
Quoted 3 lines · Dongliang Mu
If
i40e_up_completefails ini40e_vsi_open, it goes toerr_up_complete. The labelerr_set_queueshas an issue: if the else branch is executed, there is no need to executei40e_vsi_request_irq.This is unnecessary: if the else branch is executed then control will goto
err_setup_rx, skipping overi40e_up_complete().
Oh, yes. Thank you. Please ignore this patch.
Quoted 29 lines
sln
Quoted 25 lines
Fix this by adding a condition of
i40e_vsi_free_irq.Reported-by Dongliang Mu (mudongliangabcd at gmail.com)Fixes 9c04cfcd4aad ("i40e: Fix error handling in i40e_vsi_open")Fixes c22e3c6c7912 ("i40e: prep vsi_open logic for non-netdev cases")Signed-off-by Dongliang Mu <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/intel/i40e/i40e_main.c +2
-1@@ -8720,7 +8720,8 @@ int i40e_vsi_open(struct i40e_vsi *vsi) err_up_complete:i40e_down (vsi); err_set_queues: -i40e_vsi_free_irq (vsi); +if ((vsi->netdev) || (vsi->type ==I40E_VSI_FDIR )) +i40e_vsi_free_irq (vsi); err_setup_rx:i40e_vsi_free_rx_resources (vsi); err_setup_tx: