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 /drivers/net/hyperv/netvsc_drv.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 'drivers/net/hyperv/netvsc_drv.c')
-rw-r--r-- | drivers/net/hyperv/netvsc_drv.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index f825a629a699..a9975c7e6461 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
@@ -304,9 +304,9 @@ int netvsc_recv_callback(struct hv_device *device_obj, | |||
304 | static void netvsc_get_drvinfo(struct net_device *net, | 304 | static void netvsc_get_drvinfo(struct net_device *net, |
305 | struct ethtool_drvinfo *info) | 305 | struct ethtool_drvinfo *info) |
306 | { | 306 | { |
307 | strcpy(info->driver, KBUILD_MODNAME); | 307 | strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver)); |
308 | strcpy(info->version, HV_DRV_VERSION); | 308 | strlcpy(info->version, HV_DRV_VERSION, sizeof(info->version)); |
309 | strcpy(info->fw_version, "N/A"); | 309 | strlcpy(info->fw_version, "N/A", sizeof(info->fw_version)); |
310 | } | 310 | } |
311 | 311 | ||
312 | static int netvsc_change_mtu(struct net_device *ndev, int mtu) | 312 | static int netvsc_change_mtu(struct net_device *ndev, int mtu) |