aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorJohn W Linville <linville@tuxdriver.com>2015-01-13 22:06:28 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-02-08 22:01:06 -0500
commit83840e4bd5a3ae0022e5cdd02bde149338b6b499 (patch)
tree645bc201da70cf20abd83b34be11f778b7c2a0c2 /drivers/net/ethernet
parentcf86da489d9bf7abed2e7034d94e75fb17b7b1b2 (diff)
i40e: avoid use of uninitialized v_budget in i40e_init_msix
This I40E_FCOE block increments v_budget before it has been initialized, then v_budget gets overwritten a few lines later. This patch just reorders the code hunks in what I believe was the intended sequence. Coverity: CID 1260099 Signed-off-by: John W Linville <linville@tuxdriver.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index e774a23901f9..9efb69ab2ab0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6933,17 +6933,17 @@ static int i40e_init_msix(struct i40e_pf *pf)
6933 if (pf->flags & I40E_FLAG_FD_SB_ENABLED) 6933 if (pf->flags & I40E_FLAG_FD_SB_ENABLED)
6934 other_vecs++; 6934 other_vecs++;
6935 6935
6936 /* Scale down if necessary, and the rings will share vectors */
6937 pf->num_lan_msix = min_t(int, pf->num_lan_msix,
6938 (hw->func_caps.num_msix_vectors - other_vecs));
6939 v_budget = pf->num_lan_msix + other_vecs;
6940
6936#ifdef I40E_FCOE 6941#ifdef I40E_FCOE
6937 if (pf->flags & I40E_FLAG_FCOE_ENABLED) { 6942 if (pf->flags & I40E_FLAG_FCOE_ENABLED) {
6938 pf->num_fcoe_msix = pf->num_fcoe_qps; 6943 pf->num_fcoe_msix = pf->num_fcoe_qps;
6939 v_budget += pf->num_fcoe_msix; 6944 v_budget += pf->num_fcoe_msix;
6940 } 6945 }
6941
6942#endif 6946#endif
6943 /* Scale down if necessary, and the rings will share vectors */
6944 pf->num_lan_msix = min_t(int, pf->num_lan_msix,
6945 (hw->func_caps.num_msix_vectors - other_vecs));
6946 v_budget = pf->num_lan_msix + other_vecs;
6947 6947
6948 pf->msix_entries = kcalloc(v_budget, sizeof(struct msix_entry), 6948 pf->msix_entries = kcalloc(v_budget, sizeof(struct msix_entry),
6949 GFP_KERNEL); 6949 GFP_KERNEL);