Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed250ecc authored by Mitch Williams's avatar Mitch Williams Committed by Jeff Kirsher
Browse files

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: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 66ddcffb
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -642,6 +642,7 @@ static int i40evf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
	if (!indir)
		return 0;

	if (indir) {
		for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) {
			hlut_val = rd32(hw, I40E_VFQF_HLUT(i));
			indir[j++] = hlut_val & 0xff;
@@ -649,6 +650,7 @@ static int i40evf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
			indir[j++] = (hlut_val >> 16) & 0xff;
			indir[j++] = (hlut_val >> 24) & 0xff;
		}
	}
	return 0;
}