diff options
author | Mitch Williams <mitch.a.williams@intel.com> | 2015-02-24 01:58:51 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2015-03-03 04:07:29 -0500 |
commit | ed250ecc5546649e0d8a1b8f000594314a666547 (patch) | |
tree | 602237c37b262bd3cbf9b7293b52147b49400462 /drivers/net/ethernet | |
parent | 66ddcffb1afb009d352115a61e25c237915d9e04 (diff) |
i40evf: ethtool RSS fixes
Add an extra check to make sure that the indirection table pointer is
valid before dereferencing it.
Change-ID: I698adbf3daff03081d01f489dc95a9f1ad8b12f1
Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Mitch Williams <mitch.a.williams@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/i40evf/i40evf_ethtool.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c index c5ffaccb59d3..681a5d4b4f6a 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | |||
@@ -642,12 +642,14 @@ static int i40evf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, | |||
642 | if (!indir) | 642 | if (!indir) |
643 | return 0; | 643 | return 0; |
644 | 644 | ||
645 | for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) { | 645 | if (indir) { |
646 | hlut_val = rd32(hw, I40E_VFQF_HLUT(i)); | 646 | for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) { |
647 | indir[j++] = hlut_val & 0xff; | 647 | hlut_val = rd32(hw, I40E_VFQF_HLUT(i)); |
648 | indir[j++] = (hlut_val >> 8) & 0xff; | 648 | indir[j++] = hlut_val & 0xff; |
649 | indir[j++] = (hlut_val >> 16) & 0xff; | 649 | indir[j++] = (hlut_val >> 8) & 0xff; |
650 | indir[j++] = (hlut_val >> 24) & 0xff; | 650 | indir[j++] = (hlut_val >> 16) & 0xff; |
651 | indir[j++] = (hlut_val >> 24) & 0xff; | ||
652 | } | ||
651 | } | 653 | } |
652 | return 0; | 654 | return 0; |
653 | } | 655 | } |