ethtool: fix drvinfo strings set in drivers
Use strlcpy where possible to ensure the string is \0 terminated. Use always sizeof(string) instead of 32, ETHTOOL_BUSINFO_LEN and custom defines. Use snprintf instead of sprint. Remove unnecessary inits of ->fw_version Remove unnecessary inits of drvinfo struct. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
这个提交包含在:
@@ -274,8 +274,8 @@ static void uml_net_poll_controller(struct net_device *dev)
|
||||
static void uml_net_get_drvinfo(struct net_device *dev,
|
||||
struct ethtool_drvinfo *info)
|
||||
{
|
||||
strcpy(info->driver, DRIVER_NAME);
|
||||
strcpy(info->version, "42");
|
||||
strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
|
||||
strlcpy(info->version, "42", sizeof(info->version));
|
||||
}
|
||||
|
||||
static const struct ethtool_ops uml_net_ethtool_ops = {
|
||||
|
在新工单中引用
屏蔽一个用户