Skip to content

Commit

Permalink
e1000e: Use sizeof struct rather than pointer in e1000_get_eeprom()
Browse files Browse the repository at this point in the history
Don't use the sizeof the pointer to clear the result

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Roel Kluin authored and David S. Miller committed Dec 2, 2009
1 parent 07f025e commit 8528b01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/e1000e/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down

0 comments on commit 8528b01

Please sign in to comment.