aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/rionet.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/rionet.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/rionet.c')
-rw-r--r--drivers/net/rionet.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
index d8b9b1e8ee02..f433b594388e 100644
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -410,10 +410,10 @@ static void rionet_get_drvinfo(struct net_device *ndev,
410{ 410{
411 struct rionet_private *rnet = netdev_priv(ndev); 411 struct rionet_private *rnet = netdev_priv(ndev);
412 412
413 strcpy(info->driver, DRV_NAME); 413 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
414 strcpy(info->version, DRV_VERSION); 414 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
415 strcpy(info->fw_version, "n/a"); 415 strlcpy(info->fw_version, "n/a", sizeof(info->fw_version));
416 strcpy(info->bus_info, rnet->mport->name); 416 strlcpy(info->bus_info, rnet->mport->name, sizeof(info->bus_info));
417} 417}
418 418
419static u32 rionet_get_msglevel(struct net_device *ndev) 419static u32 rionet_get_msglevel(struct net_device *ndev)