diff options
author | Rick Jones <rick.jones2@hp.com> | 2011-11-09 04:58:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-14 00:35:46 -0500 |
commit | 23020ab35364f2c91133b099c2b1f7458e29aa96 (patch) | |
tree | 838cf53bb3b1670f591d404db40b5fe22b8c52fb /drivers | |
parent | 952c5ca14eab113072716ae075c6fd184f011a89 (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')
-rw-r--r-- | drivers/net/ethernet/amd/amd8111e.c | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/amd/pcnet32.c | 10 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb/cxgb2.c | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/e100.c | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/jme.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/micrel/ksz884x.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_ethtool.c | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/sis/sis190.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/sis/sis900.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/sun/niu.c | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/sun/sungem.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/sun/sunhme.c | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/via/via-rhine.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/via/via-velocity.c | 6 |
17 files changed, 74 insertions, 60 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 | ||
1421 | static int amd8111e_get_regs_len(struct net_device *dev) | 1422 | static 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 | ||
722 | static u32 pcnet32_get_link(struct net_device *dev) | 724 | static u32 pcnet32_get_link(struct net_device *dev) |
diff --git a/drivers/net/ethernet/chelsio/cxgb/cxgb2.c b/drivers/net/ethernet/chelsio/cxgb/cxgb2.c index ca26d97171b..26d0fd2d9c9 100644 --- a/drivers/net/ethernet/chelsio/cxgb/cxgb2.c +++ b/drivers/net/ethernet/chelsio/cxgb/cxgb2.c | |||
@@ -434,10 +434,11 @@ static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | |||
434 | { | 434 | { |
435 | struct adapter *adapter = dev->ml_priv; | 435 | struct adapter *adapter = dev->ml_priv; |
436 | 436 | ||
437 | strcpy(info->driver, DRV_NAME); | 437 | strlcpy(info->driver, DRV_NAME, sizeof(info->driver)); |
438 | strcpy(info->version, DRV_VERSION); | 438 | strlcpy(info->version, DRV_VERSION, sizeof(info->version)); |
439 | strcpy(info->fw_version, "N/A"); | 439 | strlcpy(info->fw_version, "N/A", sizeof(info->fw_version)); |
440 | strcpy(info->bus_info, pci_name(adapter->pdev)); | 440 | strlcpy(info->bus_info, pci_name(adapter->pdev), |
441 | sizeof(info->bus_info)); | ||
441 | } | 442 | } |
442 | 443 | ||
443 | static int get_sset_count(struct net_device *dev, int sset) | 444 | static int get_sset_count(struct net_device *dev, int sset) |
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c index 4d15c8f99c3..053560da634 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | |||
@@ -1576,11 +1576,12 @@ static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | |||
1576 | t3_get_tp_version(adapter, &tp_vers); | 1576 | t3_get_tp_version(adapter, &tp_vers); |
1577 | spin_unlock(&adapter->stats_lock); | 1577 | spin_unlock(&adapter->stats_lock); |
1578 | 1578 | ||
1579 | strcpy(info->driver, DRV_NAME); | 1579 | strlcpy(info->driver, DRV_NAME, sizeof(info->driver)); |
1580 | strcpy(info->version, DRV_VERSION); | 1580 | strlcpy(info->version, DRV_VERSION, sizeof(info->version)); |
1581 | strcpy(info->bus_info, pci_name(adapter->pdev)); | 1581 | strlcpy(info->bus_info, pci_name(adapter->pdev), |
1582 | sizeof(info->bus_info)); | ||
1582 | if (!fw_vers) | 1583 | if (!fw_vers) |
1583 | strcpy(info->fw_version, "N/A"); | 1584 | strlcpy(info->fw_version, "N/A", sizeof(info->fw_version)); |
1584 | else { | 1585 | else { |
1585 | snprintf(info->fw_version, sizeof(info->fw_version), | 1586 | snprintf(info->fw_version, sizeof(info->fw_version), |
1586 | "%s %u.%u.%u TP %u.%u.%u", | 1587 | "%s %u.%u.%u TP %u.%u.%u", |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 4c8f42afa3c..48ffe11d9aa 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | |||
@@ -1002,12 +1002,13 @@ static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | |||
1002 | { | 1002 | { |
1003 | struct adapter *adapter = netdev2adap(dev); | 1003 | struct adapter *adapter = netdev2adap(dev); |
1004 | 1004 | ||
1005 | strcpy(info->driver, KBUILD_MODNAME); | 1005 | strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver)); |
1006 | strcpy(info->version, DRV_VERSION); | 1006 | strlcpy(info->version, DRV_VERSION, sizeof(info->version)); |
1007 | strcpy(info->bus_info, pci_name(adapter->pdev)); | 1007 | strlcpy(info->bus_info, pci_name(adapter->pdev), |
1008 | sizeof(info->bus_info)); | ||
1008 | 1009 | ||
1009 | if (!adapter->params.fw_vers) | 1010 | if (!adapter->params.fw_vers) |
1010 | strcpy(info->fw_version, "N/A"); | 1011 | strlcpy(info->fw_version, "N/A", sizeof(info->fw_version)); |
1011 | else | 1012 | else |
1012 | snprintf(info->fw_version, sizeof(info->fw_version), | 1013 | snprintf(info->fw_version, sizeof(info->fw_version), |
1013 | "%u.%u.%u.%u, TP %u.%u.%u.%u", | 1014 | "%u.%u.%u.%u, TP %u.%u.%u.%u", |
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c index da9072bfca8..ee81d8e798e 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | |||
@@ -1203,9 +1203,10 @@ static void cxgb4vf_get_drvinfo(struct net_device *dev, | |||
1203 | { | 1203 | { |
1204 | struct adapter *adapter = netdev2adap(dev); | 1204 | struct adapter *adapter = netdev2adap(dev); |
1205 | 1205 | ||
1206 | strcpy(drvinfo->driver, KBUILD_MODNAME); | 1206 | strlcpy(drvinfo->driver, KBUILD_MODNAME, sizeof(drvinfo->driver)); |
1207 | strcpy(drvinfo->version, DRV_VERSION); | 1207 | strlcpy(drvinfo->version, DRV_VERSION, sizeof(drvinfo->version)); |
1208 | strcpy(drvinfo->bus_info, pci_name(to_pci_dev(dev->dev.parent))); | 1208 | strlcpy(drvinfo->bus_info, pci_name(to_pci_dev(dev->dev.parent)), |
1209 | sizeof(drvinfo->bus_info)); | ||
1209 | snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), | 1210 | snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), |
1210 | "%u.%u.%u.%u, TP %u.%u.%u.%u", | 1211 | "%u.%u.%u.%u, TP %u.%u.%u.%u", |
1211 | FW_HDR_FW_VER_MAJOR_GET(adapter->params.dev.fwrev), | 1212 | FW_HDR_FW_VER_MAJOR_GET(adapter->params.dev.fwrev), |
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c index 5a2fdf7a00c..46003278ffa 100644 --- a/drivers/net/ethernet/intel/e100.c +++ b/drivers/net/ethernet/intel/e100.c | |||
@@ -2376,10 +2376,11 @@ static void e100_get_drvinfo(struct net_device *netdev, | |||
2376 | struct ethtool_drvinfo *info) | 2376 | struct ethtool_drvinfo *info) |
2377 | { | 2377 | { |
2378 | struct nic *nic = netdev_priv(netdev); | 2378 | struct nic *nic = netdev_priv(netdev); |
2379 | strcpy(info->driver, DRV_NAME); | 2379 | strlcpy(info->driver, DRV_NAME, sizeof(info->driver)); |
2380 | strcpy(info->version, DRV_VERSION); | 2380 | strlcpy(info->version, DRV_VERSION, sizeof(info->version)); |
2381 | strcpy(info->fw_version, "N/A"); | 2381 | strlcpy(info->fw_version, "N/A", sizeof(info->fw_version)); |
2382 | strcpy(info->bus_info, pci_name(nic->pdev)); | 2382 | strlcpy(info->bus_info, pci_name(nic->pdev), |
2383 | sizeof(info->bus_info)); | ||
2383 | } | 2384 | } |
2384 | 2385 | ||
2385 | #define E100_PHY_REGS 0x1C | 2386 | #define E100_PHY_REGS 0x1C |
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c index 7becff1f387..7d88c7c28a7 100644 --- a/drivers/net/ethernet/jme.c +++ b/drivers/net/ethernet/jme.c | |||
@@ -2292,9 +2292,9 @@ jme_get_drvinfo(struct net_device *netdev, | |||
2292 | { | 2292 | { |
2293 | struct jme_adapter *jme = netdev_priv(netdev); | 2293 | struct jme_adapter *jme = netdev_priv(netdev); |
2294 | 2294 | ||
2295 | strcpy(info->driver, DRV_NAME); | 2295 | strlcpy(info->driver, DRV_NAME, sizeof(info->driver)); |
2296 | strcpy(info->version, DRV_VERSION); | 2296 | strlcpy(info->version, DRV_VERSION, sizeof(info->version)); |
2297 | strcpy(info->bus_info, pci_name(jme->pdev)); | 2297 | strlcpy(info->bus_info, pci_name(jme->pdev), sizeof(info->bus_info)); |
2298 | } | 2298 | } |
2299 | 2299 | ||
2300 | static int | 2300 | static int |
diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c index 7ece990381c..3b67fe65404 100644 --- a/drivers/net/ethernet/micrel/ksz884x.c +++ b/drivers/net/ethernet/micrel/ksz884x.c | |||
@@ -6093,9 +6093,10 @@ static void netdev_get_drvinfo(struct net_device *dev, | |||
6093 | struct dev_priv *priv = netdev_priv(dev); | 6093 | struct dev_priv *priv = netdev_priv(dev); |
6094 | struct dev_info *hw_priv = priv->adapter; | 6094 | struct dev_info *hw_priv = priv->adapter; |
6095 | 6095 | ||
6096 | strcpy(info->driver, DRV_NAME); | 6096 | strlcpy(info->driver, DRV_NAME, sizeof(info->driver)); |
6097 | strcpy(info->version, DRV_VERSION); | 6097 | strlcpy(info->version, DRV_VERSION, sizeof(info->version)); |
6098 | strcpy(info->bus_info, pci_name(hw_priv->pdev)); | 6098 | strlcpy(info->bus_info, pci_name(hw_priv->pdev), |
6099 | sizeof(info->bus_info)); | ||
6099 | } | 6100 | } |
6100 | 6101 | ||
6101 | /** | 6102 | /** |
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_ethtool.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_ethtool.c index 8c8027176be..0063194adb9 100644 --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_ethtool.c +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_ethtool.c | |||
@@ -161,10 +161,11 @@ static void pch_gbe_get_drvinfo(struct net_device *netdev, | |||
161 | { | 161 | { |
162 | struct pch_gbe_adapter *adapter = netdev_priv(netdev); | 162 | struct pch_gbe_adapter *adapter = netdev_priv(netdev); |
163 | 163 | ||
164 | strcpy(drvinfo->driver, KBUILD_MODNAME); | 164 | strlcpy(drvinfo->driver, KBUILD_MODNAME, sizeof(drvinfo->driver)); |
165 | strcpy(drvinfo->version, pch_driver_version); | 165 | strlcpy(drvinfo->version, pch_driver_version, sizeof(drvinfo->version)); |
166 | strcpy(drvinfo->fw_version, "N/A"); | 166 | strlcpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version)); |
167 | strcpy(drvinfo->bus_info, pci_name(adapter->pdev)); | 167 | strlcpy(drvinfo->bus_info, pci_name(adapter->pdev), |
168 | sizeof(drvinfo->bus_info)); | ||
168 | drvinfo->regdump_len = pch_gbe_get_regs_len(netdev); | 169 | drvinfo->regdump_len = pch_gbe_get_regs_len(netdev); |
169 | } | 170 | } |
170 | 171 | ||
diff --git a/drivers/net/ethernet/sis/sis190.c b/drivers/net/ethernet/sis/sis190.c index 1b4658c9939..220e98219a3 100644 --- a/drivers/net/ethernet/sis/sis190.c +++ b/drivers/net/ethernet/sis/sis190.c | |||
@@ -1760,9 +1760,10 @@ static void sis190_get_drvinfo(struct net_device *dev, | |||
1760 | { | 1760 | { |
1761 | struct sis190_private *tp = netdev_priv(dev); | 1761 | struct sis190_private *tp = netdev_priv(dev); |
1762 | 1762 | ||
1763 | strcpy(info->driver, DRV_NAME); | 1763 | strlcpy(info->driver, DRV_NAME, sizeof(info->driver)); |
1764 | strcpy(info->version, DRV_VERSION); | 1764 | strlcpy(info->version, DRV_VERSION, sizeof(info->version)); |
1765 | strcpy(info->bus_info, pci_name(tp->pci_dev)); | 1765 | strlcpy(info->bus_info, pci_name(tp->pci_dev), |
1766 | sizeof(info->bus_info)); | ||
1766 | } | 1767 | } |
1767 | 1768 | ||
1768 | static int sis190_get_regs_len(struct net_device *dev) | 1769 | static int sis190_get_regs_len(struct net_device *dev) |
diff --git a/drivers/net/ethernet/sis/sis900.c b/drivers/net/ethernet/sis/sis900.c index a184abc5ef1..c8efc708c79 100644 --- a/drivers/net/ethernet/sis/sis900.c +++ b/drivers/net/ethernet/sis/sis900.c | |||
@@ -1991,9 +1991,10 @@ static void sis900_get_drvinfo(struct net_device *net_dev, | |||
1991 | { | 1991 | { |
1992 | struct sis900_private *sis_priv = netdev_priv(net_dev); | 1992 | struct sis900_private *sis_priv = netdev_priv(net_dev); |
1993 | 1993 | ||
1994 | strcpy (info->driver, SIS900_MODULE_NAME); | 1994 | strlcpy(info->driver, SIS900_MODULE_NAME, sizeof(info->driver)); |
1995 | strcpy (info->version, SIS900_DRV_VERSION); | 1995 | strlcpy(info->version, SIS900_DRV_VERSION, sizeof(info->version)); |
1996 | strcpy (info->bus_info, pci_name(sis_priv->pci_dev)); | 1996 | strlcpy(info->bus_info, pci_name(sis_priv->pci_dev), |
1997 | sizeof(info->bus_info)); | ||
1997 | } | 1998 | } |
1998 | 1999 | ||
1999 | static u32 sis900_get_msglevel(struct net_device *net_dev) | 2000 | static u32 sis900_get_msglevel(struct net_device *net_dev) |
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index 73c708107a3..3ebeb9d400f 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c | |||
@@ -6823,12 +6823,13 @@ static void niu_get_drvinfo(struct net_device *dev, | |||
6823 | struct niu *np = netdev_priv(dev); | 6823 | struct niu *np = netdev_priv(dev); |
6824 | struct niu_vpd *vpd = &np->vpd; | 6824 | struct niu_vpd *vpd = &np->vpd; |
6825 | 6825 | ||
6826 | strcpy(info->driver, DRV_MODULE_NAME); | 6826 | strlcpy(info->driver, DRV_MODULE_NAME, sizeof(info->driver)); |
6827 | strcpy(info->version, DRV_MODULE_VERSION); | 6827 | strlcpy(info->version, DRV_MODULE_VERSION, sizeof(info->version)); |
6828 | sprintf(info->fw_version, "%d.%d", | 6828 | snprintf(info->fw_version, sizeof(info->fw_version), "%d.%d", |
6829 | vpd->fcode_major, vpd->fcode_minor); | 6829 | vpd->fcode_major, vpd->fcode_minor); |
6830 | if (np->parent->plat_type != PLAT_TYPE_NIU) | 6830 | if (np->parent->plat_type != PLAT_TYPE_NIU) |
6831 | strcpy(info->bus_info, pci_name(np->pdev)); | 6831 | strlcpy(info->bus_info, pci_name(np->pdev), |
6832 | sizeof(info->bus_info)); | ||
6832 | } | 6833 | } |
6833 | 6834 | ||
6834 | static int niu_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | 6835 | static int niu_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) |
diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c index ceab215bb4a..31441a870b0 100644 --- a/drivers/net/ethernet/sun/sungem.c +++ b/drivers/net/ethernet/sun/sungem.c | |||
@@ -2517,9 +2517,9 @@ static void gem_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info | |||
2517 | { | 2517 | { |
2518 | struct gem *gp = netdev_priv(dev); | 2518 | struct gem *gp = netdev_priv(dev); |
2519 | 2519 | ||
2520 | strcpy(info->driver, DRV_NAME); | 2520 | strlcpy(info->driver, DRV_NAME, sizeof(info->driver)); |
2521 | strcpy(info->version, DRV_VERSION); | 2521 | strlcpy(info->version, DRV_VERSION, sizeof(info->version)); |
2522 | strcpy(info->bus_info, pci_name(gp->pdev)); | 2522 | strlcpy(info->bus_info, pci_name(gp->pdev), sizeof(info->bus_info)); |
2523 | } | 2523 | } |
2524 | 2524 | ||
2525 | static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | 2525 | static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) |
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index cf14ab9db57..eebd52f1036 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c | |||
@@ -2457,11 +2457,11 @@ static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info | |||
2457 | { | 2457 | { |
2458 | struct happy_meal *hp = netdev_priv(dev); | 2458 | struct happy_meal *hp = netdev_priv(dev); |
2459 | 2459 | ||
2460 | strcpy(info->driver, "sunhme"); | 2460 | strlcpy(info->driver, "sunhme", sizeof(info->driver)); |
2461 | strcpy(info->version, "2.02"); | 2461 | strlcpy(info->version, "2.02", sizeof(info->version)); |
2462 | if (hp->happy_flags & HFLAG_PCI) { | 2462 | if (hp->happy_flags & HFLAG_PCI) { |
2463 | struct pci_dev *pdev = hp->happy_dev; | 2463 | struct pci_dev *pdev = hp->happy_dev; |
2464 | strcpy(info->bus_info, pci_name(pdev)); | 2464 | strlcpy(info->bus_info, pci_name(pdev), sizeof(info->bus_info)); |
2465 | } | 2465 | } |
2466 | #ifdef CONFIG_SBUS | 2466 | #ifdef CONFIG_SBUS |
2467 | else { | 2467 | else { |
@@ -2469,7 +2469,8 @@ static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info | |||
2469 | struct platform_device *op = hp->happy_dev; | 2469 | struct platform_device *op = hp->happy_dev; |
2470 | regs = of_get_property(op->dev.of_node, "regs", NULL); | 2470 | regs = of_get_property(op->dev.of_node, "regs", NULL); |
2471 | if (regs) | 2471 | if (regs) |
2472 | sprintf(info->bus_info, "SBUS:%d", | 2472 | snprintf(info->bus_info, sizeof(info->bus_info), |
2473 | "SBUS:%d", | ||
2473 | regs->which_io); | 2474 | regs->which_io); |
2474 | } | 2475 | } |
2475 | #endif | 2476 | #endif |
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c index f34dd99fe57..5587ecdf32e 100644 --- a/drivers/net/ethernet/via/via-rhine.c +++ b/drivers/net/ethernet/via/via-rhine.c | |||
@@ -2009,9 +2009,9 @@ static void netdev_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *i | |||
2009 | { | 2009 | { |
2010 | struct rhine_private *rp = netdev_priv(dev); | 2010 | struct rhine_private *rp = netdev_priv(dev); |
2011 | 2011 | ||
2012 | strcpy(info->driver, DRV_NAME); | 2012 | strlcpy(info->driver, DRV_NAME, sizeof(info->driver)); |
2013 | strcpy(info->version, DRV_VERSION); | 2013 | strlcpy(info->version, DRV_VERSION, sizeof(info->version)); |
2014 | strcpy(info->bus_info, pci_name(rp->pdev)); | 2014 | strlcpy(info->bus_info, pci_name(rp->pdev), sizeof(info->bus_info)); |
2015 | } | 2015 | } |
2016 | 2016 | ||
2017 | static int netdev_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | 2017 | static int netdev_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) |
diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c index 4535d7cc848..59bb5fd56af 100644 --- a/drivers/net/ethernet/via/via-velocity.c +++ b/drivers/net/ethernet/via/via-velocity.c | |||
@@ -3270,9 +3270,9 @@ static int velocity_set_settings(struct net_device *dev, | |||
3270 | static void velocity_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | 3270 | static void velocity_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) |
3271 | { | 3271 | { |
3272 | struct velocity_info *vptr = netdev_priv(dev); | 3272 | struct velocity_info *vptr = netdev_priv(dev); |
3273 | strcpy(info->driver, VELOCITY_NAME); | 3273 | strlcpy(info->driver, VELOCITY_NAME, sizeof(info->driver)); |
3274 | strcpy(info->version, VELOCITY_VERSION); | 3274 | strlcpy(info->version, VELOCITY_VERSION, sizeof(info->version)); |
3275 | strcpy(info->bus_info, pci_name(vptr->pdev)); | 3275 | strlcpy(info->bus_info, pci_name(vptr->pdev), sizeof(info->bus_info)); |
3276 | } | 3276 | } |
3277 | 3277 | ||
3278 | static void velocity_ethtool_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | 3278 | static void velocity_ethtool_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) |