mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
ethtool: Null-terminate filename passed to ethtool_ops::flash_device
The parameters for ETHTOOL_FLASHDEV include a filename, which ought to be null-terminated. Currently the only driver that implements ethtool_ops::flash_device attempts to add a null terminator if necessary, but does it wrongly. Do it in the ethtool core instead. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
efcdbf24fd
commit
786f528119
2 changed files with 3 additions and 5 deletions
|
|
@ -1190,6 +1190,8 @@ static noinline_for_stack int ethtool_flash_device(struct net_device *dev,
|
|||
if (!dev->ethtool_ops->flash_device)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
efl.data[ETHTOOL_FLASH_MAX_FILENAME - 1] = 0;
|
||||
|
||||
return dev->ethtool_ops->flash_device(dev, &efl);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue