diff options
-rw-r--r-- | net/core/ethtool.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index a29b43d0b450..0133b5ebd545 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -323,6 +323,11 @@ static int ethtool_get_eeprom(struct net_device *dev, void __user *useraddr) | |||
323 | bytes_remaining -= eeprom.len; | 323 | bytes_remaining -= eeprom.len; |
324 | } | 324 | } |
325 | 325 | ||
326 | eeprom.len = userbuf - (useraddr + sizeof(eeprom)); | ||
327 | eeprom.offset -= eeprom.len; | ||
328 | if (copy_to_user(useraddr, &eeprom, sizeof(eeprom))) | ||
329 | ret = -EFAULT; | ||
330 | |||
326 | kfree(data); | 331 | kfree(data); |
327 | return ret; | 332 | return ret; |
328 | } | 333 | } |