diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-01-05 19:44:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-07 00:06:31 -0500 |
commit | 7826d43f2db45c9305a6e0ba165650e1a203f517 (patch) | |
tree | a8659c995a37f58db809da9537aafac178431f31 /net/8021q | |
parent | 2afb9b533423a9b97f84181e773cf9361d98fed6 (diff) |
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>
Diffstat (limited to 'net/8021q')
-rw-r--r-- | net/8021q/vlan_dev.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 4a6d31a082b9..09f9108d4688 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -640,9 +640,9 @@ static int vlan_ethtool_get_settings(struct net_device *dev, | |||
640 | static void vlan_ethtool_get_drvinfo(struct net_device *dev, | 640 | static void vlan_ethtool_get_drvinfo(struct net_device *dev, |
641 | struct ethtool_drvinfo *info) | 641 | struct ethtool_drvinfo *info) |
642 | { | 642 | { |
643 | strcpy(info->driver, vlan_fullname); | 643 | strlcpy(info->driver, vlan_fullname, sizeof(info->driver)); |
644 | strcpy(info->version, vlan_version); | 644 | strlcpy(info->version, vlan_version, sizeof(info->version)); |
645 | strcpy(info->fw_version, "N/A"); | 645 | strlcpy(info->fw_version, "N/A", sizeof(info->fw_version)); |
646 | } | 646 | } |
647 | 647 | ||
648 | static struct rtnl_link_stats64 *vlan_dev_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) | 648 | static struct rtnl_link_stats64 *vlan_dev_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) |