From: Josh Hay Date: Fri, 4 Jan 2013 03:34:36 +0000 (+0000) Subject: ixgbe: fix potential null dereference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f752be9c3de4fbb6a9b2c060f3794bd928a0ad7a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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 ==