aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/amd
diff options
context:
space:
mode:
authorRick Jones <rick.jones2@hp.com>2011-11-09 04:58:07 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-14 00:35:46 -0500
commit23020ab35364f2c91133b099c2b1f7458e29aa96 (patch)
tree838cf53bb3b1670f591d404db40b5fe22b8c52fb /drivers/net/ethernet/amd
parent952c5ca14eab113072716ae075c6fd184f011a89 (diff)
Sweep additional floors of strcpy in .get_drvinfo routines
Perform another round of floor sweeping, converting the .get_drvinfo routines of additional drivers from strcpy to strlcpy along with some conversion of sprintf to snprintf. Signed-off-by: Rick Jones <rick.jones2@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amd')
-rw-r--r--drivers/net/ethernet/amd/amd8111e.c9
-rw-r--r--drivers/net/ethernet/amd/pcnet32.c10
2 files changed, 11 insertions, 8 deletions
diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
index a9745f4ddbf..a388118ee8e 100644
--- a/drivers/net/ethernet/amd/amd8111e.c
+++ b/drivers/net/ethernet/amd/amd8111e.c
@@ -1412,10 +1412,11 @@ static void amd8111e_get_drvinfo(struct net_device* dev, struct ethtool_drvinfo
1412{ 1412{
1413 struct amd8111e_priv *lp = netdev_priv(dev); 1413 struct amd8111e_priv *lp = netdev_priv(dev);
1414 struct pci_dev *pci_dev = lp->pci_dev; 1414 struct pci_dev *pci_dev = lp->pci_dev;
1415 strcpy (info->driver, MODULE_NAME); 1415 strlcpy(info->driver, MODULE_NAME, sizeof(info->driver));
1416 strcpy (info->version, MODULE_VERS); 1416 strlcpy(info->version, MODULE_VERS, sizeof(info->version));
1417 sprintf(info->fw_version,"%u",chip_version); 1417 snprintf(info->fw_version, sizeof(info->fw_version),
1418 strcpy (info->bus_info, pci_name(pci_dev)); 1418 "%u", chip_version);
1419 strlcpy(info->bus_info, pci_name(pci_dev), sizeof(info->bus_info));
1419} 1420}
1420 1421
1421static int amd8111e_get_regs_len(struct net_device *dev) 1422static int amd8111e_get_regs_len(struct net_device *dev)
diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
index f92bc6e3482..20e6dab0186 100644
--- a/drivers/net/ethernet/amd/pcnet32.c
+++ b/drivers/net/ethernet/amd/pcnet32.c
@@ -711,12 +711,14 @@ static void pcnet32_get_drvinfo(struct net_device *dev,
711{ 711{
712 struct pcnet32_private *lp = netdev_priv(dev); 712 struct pcnet32_private *lp = netdev_priv(dev);
713 713
714 strcpy(info->driver, DRV_NAME); 714 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
715 strcpy(info->version, DRV_VERSION); 715 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
716 if (lp->pci_dev) 716 if (lp->pci_dev)
717 strcpy(info->bus_info, pci_name(lp->pci_dev)); 717 strlcpy(info->bus_info, pci_name(lp->pci_dev),
718 sizeof(info->bus_info));
718 else 719 else
719 sprintf(info->bus_info, "VLB 0x%lx", dev->base_addr); 720 snprintf(info->bus_info, sizeof(info->bus_info),
721 "VLB 0x%lx", dev->base_addr);
720} 722}
721 723
722static u32 pcnet32_get_link(struct net_device *dev) 724static u32 pcnet32_get_link(struct net_device *dev)