aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/catc.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2013-01-05 19:44:26 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-07 00:06:31 -0500
commit7826d43f2db45c9305a6e0ba165650e1a203f517 (patch)
treea8659c995a37f58db809da9537aafac178431f31 /drivers/net/usb/catc.c
parent2afb9b533423a9b97f84181e773cf9361d98fed6 (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/usb/catc.c')
-rw-r--r--drivers/net/usb/catc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c
index 18d9579123ea..8d5cac2d8e33 100644
--- a/drivers/net/usb/catc.c
+++ b/drivers/net/usb/catc.c
@@ -685,9 +685,9 @@ static void catc_get_drvinfo(struct net_device *dev,
685 struct ethtool_drvinfo *info) 685 struct ethtool_drvinfo *info)
686{ 686{
687 struct catc *catc = netdev_priv(dev); 687 struct catc *catc = netdev_priv(dev);
688 strncpy(info->driver, driver_name, ETHTOOL_BUSINFO_LEN); 688 strlcpy(info->driver, driver_name, sizeof(info->driver));
689 strncpy(info->version, DRIVER_VERSION, ETHTOOL_BUSINFO_LEN); 689 strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
690 usb_make_path (catc->usbdev, info->bus_info, sizeof info->bus_info); 690 usb_make_path(catc->usbdev, info->bus_info, sizeof(info->bus_info));
691} 691}
692 692
693static int catc_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) 693static int catc_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)