[Intel-wired-lan] [v2 next PATCH S29 08/14] i40e: add check for null vsi
Avinash Dayanand
avinash.dayanand at intel.com
Thu Feb 18 17:19:24 UTC 2016
From: John Underwood <johnx.underwood at intel.com>
Return from i40e_vsi_reinit_setup() if vsi param is NULL.
This makes this code consistent with all the other code that
checks for NULL before using one of the VSI pointers accessed
with an indexed variable. (Indexed VSI pointers are
intentionally set to NULL in i40e_vsi_clear() and
i40e_remove().
v2: change patch title
Signed-off-by: John Underwood <johnx.underwood at intel.com>
Change-ID: I3bc8b909c70fd2439334eeae994d151f61480985
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 2a02f93..3c910ef 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -9579,10 +9579,15 @@ vector_setup_out:
**/
static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)
{
- struct i40e_pf *pf = vsi->back;
+ struct i40e_pf *pf;
u8 enabled_tc;
int ret;
+ if (!vsi)
+ return NULL;
+
+ pf = vsi->back;
+
i40e_put_lump(pf->qp_pile, vsi->base_queue, vsi->idx);
i40e_vsi_clear_rings(vsi);
--
2.1.0
More information about the Intel-wired-lan
mailing list