mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
e1000: fix memcpy in e1000_get_strings
drivers/net/e1000/e1000_ethtool.c:113: #define E1000_TEST_LEN sizeof(e1000_gstrings_test) / ETH_GSTRING_LEN drivers/net/e1000e/ethtool.c:106: #define E1000_TEST_LEN sizeof(e1000_gstrings_test) / ETH_GSTRING_LEN E1000_TEST_LEN*ETH_GSTRING_LEN will expand to sizeof(e1000_gstrings_test) / (ETH_GSTRING_LEN * ETH_GSTRING_LEN) A lack of parentheses around defines causes unexpected results due to operator precedences. Signed-off-by: Roel Kluin <[email protected]> Signed-off-by: Auke Kok <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
This commit is contained in:
parent
70eba18b56
commit
c32bc6e9b0
2 changed files with 2 additions and 2 deletions
|
|
@ -1923,7 +1923,7 @@ e1000_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data)
|
|||
switch (stringset) {
|
||||
case ETH_SS_TEST:
|
||||
memcpy(data, *e1000_gstrings_test,
|
||||
E1000_TEST_LEN*ETH_GSTRING_LEN);
|
||||
sizeof(e1000_gstrings_test));
|
||||
break;
|
||||
case ETH_SS_STATS:
|
||||
for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) {
|
||||
|
|
|
|||
|
|
@ -1739,7 +1739,7 @@ static void e1000_get_strings(struct net_device *netdev, u32 stringset,
|
|||
switch (stringset) {
|
||||
case ETH_SS_TEST:
|
||||
memcpy(data, *e1000_gstrings_test,
|
||||
E1000_TEST_LEN*ETH_GSTRING_LEN);
|
||||
sizeof(e1000_gstrings_test));
|
||||
break;
|
||||
case ETH_SS_STATS:
|
||||
for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue