Skip to contentSkip to conversation

i40evf:Add missing error check in the function i40evf_init_task

PATCH New Nicholas Krause 1 participant 1 message Oct 28, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i40evf:Add missing error check in the function i40evf_init_task

This adds the missing error check in the function i40evf_init_task for checking the return value of the call to the function i40evf_map_rings_to_vectors and if this function call does indeed return a error code jump immediately to the goto label err_sw_init in order to cleanup before returning to the caller rather then continuing the function, i40evf_map_rings_to_vector's intended work after this non recoverable failed function call.

---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +3 -1
index e85849b..cf1f3fd 100644
@@ -2264,7 +2264,9 @@ static void i40evf_init_task(struct work_struct *work)
 	err = i40evf_init_interrupt_scheme(adapter);
 	if (err)
 		goto err_sw_init;
-	i40evf_map_rings_to_vectors(adapter);
+	err = i40evf_map_rings_to_vectors(adapter);
+	if (err)
+		goto err_sw_init;
 	if (!RSS_AQ(adapter))
 		i40evf_configure_rss(adapter);
 	err = i40evf_request_misc_irq(adapter);
Signature · 1 line
2.1.4