e1000e: Use sizeof struct rather than pointer in e1000_get_eeprom()
authorRoel Kluin <roel.kluin@gmail.com>
Tue, 1 Dec 2009 15:54:24 +0000 (15:54 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Dec 2009 08:35:56 +0000 (00:35 -0800)
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>
drivers/net/e1000e/ethtool.c

index b6243cad3103edba9255c6a98dde7da1ab2f6a37..0aa50c229c79cee81d134d1ab1129360db1ec99c 100644 (file)
@@ -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++)