From: Roel Kluin Date: Tue, 1 Dec 2009 15:54:24 +0000 (+0000) Subject: e1000e: Use sizeof struct rather than pointer in e1000_get_eeprom() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8528b016d64a7c1c97ba6540ab53a538348d5026;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: Roel Kluin Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c index b6243cad3103..0aa50c229c79 100644 --- a/drivers/net/e1000e/ethtool.c +++ b/drivers/net/e1000e/ethtool.c @@ -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++)