summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel
diff options
context:
space:
mode:
authorMitch Williams <mitch.a.williams@intel.com>2016-09-13 00:18:43 +0300
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2016-09-25 08:50:05 +0300
commita4fa59cc5bb028ebb8048e8dcb6f92b2a1ea07f6 (patch)
tree5f63446a5142d39d7707bacff267d89fd235ebdb /drivers/net/ethernet/intel
parent1eb846ac90b956e52f4269d80f13cfbe1df6850b (diff)
downloadlinux-a4fa59cc5bb028ebb8048e8dcb6f92b2a1ea07f6.tar.xz
i40e: don't configure zero-size RSS table
In some rare cases, we might get a VSI with no queues. In this case, we cannot configure RSS on this VSI as it will try to divide by zero when configuring the lookup table. Change-ID: I6ae173a7dd3481a081e079eb10eb80275de2adb0 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index b434d07d98cd..8176596932be 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8282,6 +8282,8 @@ static int i40e_pf_config_rss(struct i40e_pf *pf)
if (!vsi->rss_size)
vsi->rss_size = min_t(int, pf->alloc_rss_size,
vsi->num_queue_pairs);
+ if (!vsi->rss_size)
+ return -EINVAL;
lut = kzalloc(vsi->rss_table_size, GFP_KERNEL);
if (!lut)