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/openvswitch/vport-internal_dev.c | |
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/openvswitch/vport-internal_dev.c')
-rw-r--r-- | net/openvswitch/vport-internal_dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c index 44cd5c3a4c22..0531de6c7a4a 100644 --- a/net/openvswitch/vport-internal_dev.c +++ b/net/openvswitch/vport-internal_dev.c | |||
@@ -97,7 +97,7 @@ static int internal_dev_stop(struct net_device *netdev) | |||
97 | static void internal_dev_getinfo(struct net_device *netdev, | 97 | static void internal_dev_getinfo(struct net_device *netdev, |
98 | struct ethtool_drvinfo *info) | 98 | struct ethtool_drvinfo *info) |
99 | { | 99 | { |
100 | strcpy(info->driver, "openvswitch"); | 100 | strlcpy(info->driver, "openvswitch", sizeof(info->driver)); |
101 | } | 101 | } |
102 | 102 | ||
103 | static const struct ethtool_ops internal_dev_ethtool_ops = { | 103 | static const struct ethtool_ops internal_dev_ethtool_ops = { |