From f752be9c3de4fbb6a9b2c060f3794bd928a0ad7a Mon Sep 17 00:00:00 2001 From: Josh Hay Date: Fri, 4 Jan 2013 03:34:36 +0000 Subject: [PATCH] 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: Josh Hay Tested-by: Phil Schmitt Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index 216203ece6ed..bafd141193af 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c @@ -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 == -- 2.34.1