提交 f752be9c 编写于 作者: J Josh Hay 提交者: Jeff Kirsher

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: NJosh Hay <joshua.a.hay@intel.com>
Tested-by: NPhil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 07ce870b
...@@ -1040,6 +1040,9 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev, ...@@ -1040,6 +1040,9 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev,
p = (char *) adapter + p = (char *) adapter +
ixgbe_gstrings_stats[i].stat_offset; ixgbe_gstrings_stats[i].stat_offset;
break; break;
default:
data[i] = 0;
continue;
} }
data[i] = (ixgbe_gstrings_stats[i].sizeof_stat == data[i] = (ixgbe_gstrings_stats[i].sizeof_stat ==
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册