Skip to content

Commit

Permalink
ixgbe: fix potential null dereference
Browse files Browse the repository at this point in the history
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 <joshua.a.hay@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Josh Hay authored and Jeff Kirsher committed Feb 5, 2013
1 parent 07ce870 commit f752be9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ==
Expand Down

0 comments on commit f752be9

Please sign in to comment.