i40evf: dereference VSI after VSI has been null checked
authorColin Ian King <colin.king@canonical.com>
Mon, 20 Mar 2017 12:03:03 +0000 (12:03 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 27 Mar 2017 23:47:44 +0000 (16:47 -0700)
commit703ba88548082f91970ee91c9fb64ab582e391cd
treea8a88790e807c4b7a58e3d7d9c8e4ff22238f936
parentc76cb6ed5431756071cc13635db70234597b9cf7
i40evf: dereference VSI after VSI has been null checked

VSI is being dereferenced before the VSI null check; if VSI is
null we end up with a null pointer dereference.  Fix this by
performing VSI deference after the VSI null check.  Also remove
the need for using adapter by using vsi->back->cinst.

Detected by CoverityScan, CID#1419696, CID#1419697
("Dereference before null check")

Fixes: ed0e894de7c133 ("i40evf: add client interface")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40evf/i40evf_client.c