ethtool: Null-terminate filename passed to ethtool_ops::flash_device
[pandora-kernel.git] / net / core / ethtool.c
index f444817..2b587ec 100644 (file)
@@ -1549,6 +1549,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);
 }