提交 8528b016 编写于 作者: R Roel Kluin 提交者: David S. Miller

e1000e: Use sizeof struct rather than pointer in e1000_get_eeprom()

Don't use the sizeof the pointer to clear the result
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 07f025e6
......@@ -535,7 +535,8 @@ static int e1000_get_eeprom(struct net_device *netdev,
if (ret_val) {
/* a read error occurred, throw away the result */
memset(eeprom_buff, 0xff, sizeof(eeprom_buff));
memset(eeprom_buff, 0xff, sizeof(u16) *
(last_word - first_word + 1));
} else {
/* Device's eeprom is always little-endian, word addressable */
for (i = 0; i < last_word - first_word + 1; i++)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册