From 61c758166701c4f156c0aba10260f5729b1a6f43 Mon Sep 17 00:00:00 2001 From: Bruce Allan Date: Thu, 9 Dec 2010 23:04:25 +0000 Subject: [PATCH] e1000e: static analysis tools complain of a possible null ptr p dereference Adding this default case resolves the issue. v2- Removed "break" in default case based on feedback Signed-off-by: Bruce Allan Tested-by: Emil Tantilov Signed-off-by: Jeff Kirsher --- drivers/net/e1000e/ethtool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c index c10dc694d733..39349d6dcd0b 100644 --- a/drivers/net/e1000e/ethtool.c +++ b/drivers/net/e1000e/ethtool.c @@ -1978,6 +1978,9 @@ static void e1000_get_ethtool_stats(struct net_device *netdev, p = (char *) adapter + e1000_gstrings_stats[i].stat_offset; break; + default: + data[i] = 0; + continue; } data[i] = (e1000_gstrings_stats[i].sizeof_stat == -- 2.20.1