aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sun/sunhme.c
diff options
context:
space:
mode:
authorRick Jones <rick.jones2@hp.com>2011-11-09 09:58:07 +0000
committerDavid S. Miller <davem@davemloft.net>2011-11-14 00:35:46 -0500
commit23020ab35364f2c91133b099c2b1f7458e29aa96 (patch)
tree838cf53bb3b1670f591d404db40b5fe22b8c52fb /drivers/net/ethernet/sun/sunhme.c
parentfsl_pq_mdio: Clean up tbi address configuration (diff)
downloadlinux-dev-23020ab35364f2c91133b099c2b1f7458e29aa96.tar.xz
linux-dev-23020ab35364f2c91133b099c2b1f7458e29aa96.zip
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/sun/sunhme.c')
-rw-r--r--drivers/net/ethernet/sun/sunhme.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
index cf14ab9db576..eebd52f10365 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
{
struct happy_meal *hp = netdev_priv(dev);
- strcpy(info->driver, "sunhme");
- strcpy(info->version, "2.02");
+ strlcpy(info->driver, "sunhme", sizeof(info->driver));
+ strlcpy(info->version, "2.02", sizeof(info->version));
if (hp->happy_flags & HFLAG_PCI) {
struct pci_dev *pdev = hp->happy_dev;
- strcpy(info->bus_info, pci_name(pdev));
+ strlcpy(info->bus_info, pci_name(pdev), sizeof(info->bus_info));
}
#ifdef CONFIG_SBUS
else {
@@ -2469,7 +2469,8 @@ static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info
struct platform_device *op = hp->happy_dev;
regs = of_get_property(op->dev.of_node, "regs", NULL);
if (regs)
- sprintf(info->bus_info, "SBUS:%d",
+ snprintf(info->bus_info, sizeof(info->bus_info),
+ "SBUS:%d",
regs->which_io);
}
#endif