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

Commit f752be9c authored by Josh Hay's avatar Josh Hay Committed by Jeff Kirsher
Browse files

ixgbe: fix potential null dereference



This patch adds a default case which goes to the next loop iteration
in the case where p is not set, preventing p from being dereferenced.

Signed-off-by: default avatarJosh Hay <joshua.a.hay@intel.com>
Tested-by: default avatarPhil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 07ce870b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1040,6 +1040,9 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev,
			p = (char *) adapter +
					ixgbe_gstrings_stats[i].stat_offset;
			break;
		default:
			data[i] = 0;
			continue;
		}

		data[i] = (ixgbe_gstrings_stats[i].sizeof_stat ==