summaryrefslogtreecommitdiff
path: root/drivers/net/usb/sierra_net.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2013-01-06 04:44:26 +0400
committerDavid S. Miller <davem@davemloft.net>2013-01-07 09:06:31 +0400
commit7826d43f2db45c9305a6e0ba165650e1a203f517 (patch)
treea8659c995a37f58db809da9537aafac178431f31 /drivers/net/usb/sierra_net.c
parent2afb9b533423a9b97f84181e773cf9361d98fed6 (diff)
downloadlinux-7826d43f2db45c9305a6e0ba165650e1a203f517.tar.xz
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/usb/sierra_net.c')
-rw-r--r--drivers/net/usb/sierra_net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
index 18dd4257ab17..453aa6c1277c 100644
--- a/drivers/net/usb/sierra_net.c
+++ b/drivers/net/usb/sierra_net.c
@@ -598,8 +598,8 @@ static void sierra_net_get_drvinfo(struct net_device *net,
{
/* Inherit standard device info */
usbnet_get_drvinfo(net, info);
- strncpy(info->driver, driver_name, sizeof info->driver);
- strncpy(info->version, DRIVER_VERSION, sizeof info->version);
+ strlcpy(info->driver, driver_name, sizeof(info->driver));
+ strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
}
static u32 sierra_net_get_link(struct net_device *net)