summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/brocade/bna/bnad_ethtool.c
diff options
context:
space:
mode:
authorRick Jones <rick.jones2@hp.com>2011-11-07 13:29:27 +0000
committerDavid S. Miller <davem@davemloft.net>2011-11-08 15:11:57 -0500
commit68aad78c5023b8aa82da99b47f9d8cf40e8ca453 (patch)
treec9f90903bd2e7831ea6fc5231affa3b9fc908b73 /drivers/net/ethernet/brocade/bna/bnad_ethtool.c
parent34d2d89f2d7da3b72b3157e778bbf709047ded97 (diff)
downloadblackbird-obmc-linux-68aad78c5023b8aa82da99b47f9d8cf40e8ca453.tar.gz
blackbird-obmc-linux-68aad78c5023b8aa82da99b47f9d8cf40e8ca453.zip
sweep the floors and convert some .get_drvinfo routines to strlcpy
Per the mention made by Ben Hutchings that strlcpy is now the preferred string copy routine for a .get_drvinfo routine, do a bit of floor sweeping and convert some of the as-yet unconverted ethernet drivers to it. Signed-off-by: Rick Jones <rick.jones2@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/brocade/bna/bnad_ethtool.c')
-rw-r--r--drivers/net/ethernet/brocade/bna/bnad_ethtool.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c
index fd3dcc1e9145..38d5c66075f9 100644
--- a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c
+++ b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c
@@ -296,8 +296,8 @@ bnad_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
struct bfa_ioc_attr *ioc_attr;
unsigned long flags;
- strcpy(drvinfo->driver, BNAD_NAME);
- strcpy(drvinfo->version, BNAD_VERSION);
+ strlcpy(drvinfo->driver, BNAD_NAME, sizeof(drvinfo->driver));
+ strlcpy(drvinfo->version, BNAD_VERSION, sizeof(drvinfo->version));
ioc_attr = kzalloc(sizeof(*ioc_attr), GFP_KERNEL);
if (ioc_attr) {
@@ -305,12 +305,13 @@ bnad_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
bfa_nw_ioc_get_attr(&bnad->bna.ioceth.ioc, ioc_attr);
spin_unlock_irqrestore(&bnad->bna_lock, flags);
- strncpy(drvinfo->fw_version, ioc_attr->adapter_attr.fw_ver,
- sizeof(drvinfo->fw_version) - 1);
+ strlcpy(drvinfo->fw_version, ioc_attr->adapter_attr.fw_ver,
+ sizeof(drvinfo->fw_version));
kfree(ioc_attr);
}
- strncpy(drvinfo->bus_info, pci_name(bnad->pcidev), ETHTOOL_BUSINFO_LEN);
+ strlcpy(drvinfo->bus_info, pci_name(bnad->pcidev),
+ sizeof(drvinfo->bus_info));
}
static void
OpenPOWER on IntegriCloud