net/i40e: fix dereference before null check
authorBeilei Xing <beilei.xing@intel.com>
Tue, 5 Jul 2016 06:10:04 +0000 (14:10 +0800)
committerBruce Richardson <bruce.richardson@intel.com>
Fri, 8 Jul 2016 20:50:53 +0000 (22:50 +0200)
commitb282ea2ada5dc519266d4cb4630fdff2f8c593d3
treef77640f62be37dc9b57e8f0e26be007abd26deb5
parent3a70ade568307a5700036a81766045aae2501345
net/i40e: fix dereference before null check

Null-checking vsi suggests that it may be null, but it
has been dereferenced before null-checking. So move the
check to before the assignment statement using the pointer.

Coverity issue: 119265, 119266
Fixes: d0a349409bd7 ("i40e: support AQ based RSS config")
Fixes: 647d1eaf758b ("i40evf: support AQ based RSS config")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
drivers/net/i40e/i40e_ethdev.c
drivers/net/i40e/i40e_ethdev_vf.c