aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/tehuti
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/ethernet/tehuti
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/ethernet/tehuti')
-rw-r--r--drivers/net/ethernet/tehuti/tehuti.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c
index 1e4d743ff03e..e15cc71b826d 100644
--- a/drivers/net/ethernet/tehuti/tehuti.c
+++ b/drivers/net/ethernet/tehuti/tehuti.c
@@ -2179,10 +2179,10 @@ bdx_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
2179{ 2179{
2180 struct bdx_priv *priv = netdev_priv(netdev); 2180 struct bdx_priv *priv = netdev_priv(netdev);
2181 2181
2182 strlcat(drvinfo->driver, BDX_DRV_NAME, sizeof(drvinfo->driver)); 2182 strlcpy(drvinfo->driver, BDX_DRV_NAME, sizeof(drvinfo->driver));
2183 strlcat(drvinfo->version, BDX_DRV_VERSION, sizeof(drvinfo->version)); 2183 strlcpy(drvinfo->version, BDX_DRV_VERSION, sizeof(drvinfo->version));
2184 strlcat(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version)); 2184 strlcpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version));
2185 strlcat(drvinfo->bus_info, pci_name(priv->pdev), 2185 strlcpy(drvinfo->bus_info, pci_name(priv->pdev),
2186 sizeof(drvinfo->bus_info)); 2186 sizeof(drvinfo->bus_info));
2187 2187
2188 drvinfo->n_stats = ((priv->stats_flag) ? ARRAY_SIZE(bdx_stat_names) : 0); 2188 drvinfo->n_stats = ((priv->stats_flag) ? ARRAY_SIZE(bdx_stat_names) : 0);