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/bridge/br_device.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/bridge/br_device.c')
-rw-r--r-- | net/bridge/br_device.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index 38974f70ec7b..e1bc090bc00a 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c | |||
@@ -184,10 +184,10 @@ static int br_set_mac_address(struct net_device *dev, void *p) | |||
184 | 184 | ||
185 | static void br_getinfo(struct net_device *dev, struct ethtool_drvinfo *info) | 185 | static void br_getinfo(struct net_device *dev, struct ethtool_drvinfo *info) |
186 | { | 186 | { |
187 | strcpy(info->driver, "bridge"); | 187 | strlcpy(info->driver, "bridge", sizeof(info->driver)); |
188 | strcpy(info->version, BR_VERSION); | 188 | strlcpy(info->version, BR_VERSION, sizeof(info->version)); |
189 | strcpy(info->fw_version, "N/A"); | 189 | strlcpy(info->fw_version, "N/A", sizeof(info->fw_version)); |
190 | strcpy(info->bus_info, "N/A"); | 190 | strlcpy(info->bus_info, "N/A", sizeof(info->bus_info)); |
191 | } | 191 | } |
192 | 192 | ||
193 | static netdev_features_t br_fix_features(struct net_device *dev, | 193 | static netdev_features_t br_fix_features(struct net_device *dev, |