e1000e: static analysis tools complain of a possible null ptr p dereference
authorBruce Allan <bruce.w.allan@intel.com>
Thu, 9 Dec 2010 23:04:25 +0000 (23:04 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sat, 11 Dec 2010 06:13:49 +0000 (22:13 -0800)
Adding this default case resolves the issue.

v2- Removed "break" in default case based on feedback

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/e1000e/ethtool.c

index c10dc694d7330bdffe6dc27b944bd2355fa609d7..39349d6dcd0b138b62def2bcd428930f8cba5eb5 100644 (file)
@@ -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 ==