Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33a5ba14 authored by Rick Jones's avatar Rick Jones Committed by David S. Miller
Browse files

net: sweep-up some straglers in strlcpy conversion of .get_drvinfo routines



Convert some remaining straglers' .get_drvinfo routines to use strlcpy
rather than strcpy/strncpy.

Signed-off-by: default avatarRick Jones <rick.jones2@hp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 588f0330
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -822,9 +822,10 @@ static int mace_close(struct net_device *dev)
static void netdev_get_drvinfo(struct net_device *dev,
static void netdev_get_drvinfo(struct net_device *dev,
			       struct ethtool_drvinfo *info)
			       struct ethtool_drvinfo *info)
{
{
	strcpy(info->driver, DRV_NAME);
	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
	strcpy(info->version, DRV_VERSION);
	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
	sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr);
	snprintf(info->bus_info, sizeof(info->bus_info),
		"PCMCIA 0x%lx", dev->base_addr);
}
}


static const struct ethtool_ops netdev_ethtool_ops = {
static const struct ethtool_ops netdev_ethtool_ops = {
+4 −3
Original line number Original line Diff line number Diff line
@@ -1058,9 +1058,10 @@ static void fjn_rx(struct net_device *dev)
static void netdev_get_drvinfo(struct net_device *dev,
static void netdev_get_drvinfo(struct net_device *dev,
			       struct ethtool_drvinfo *info)
			       struct ethtool_drvinfo *info)
{
{
	strcpy(info->driver, DRV_NAME);
	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
	strcpy(info->version, DRV_VERSION);
	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
	sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr);
	snprintf(info->bus_info, sizeof(info->bus_info),
		"PCMCIA 0x%lx", dev->base_addr);
}
}


static const struct ethtool_ops netdev_ethtool_ops = {
static const struct ethtool_ops netdev_ethtool_ops = {
+1 −1
Original line number Original line Diff line number Diff line
@@ -582,7 +582,7 @@ static void e1000_get_drvinfo(struct net_device *netdev,


	strlcpy(drvinfo->driver,  e1000e_driver_name,
	strlcpy(drvinfo->driver,  e1000e_driver_name,
		sizeof(drvinfo->driver));
		sizeof(drvinfo->driver));
	strncpy(drvinfo->version, e1000e_driver_version,
	strlcpy(drvinfo->version, e1000e_driver_version,
		sizeof(drvinfo->version));
		sizeof(drvinfo->version));


	/*
	/*
+2 −2
Original line number Original line Diff line number Diff line
@@ -1909,8 +1909,8 @@ static int check_if_running(struct net_device *dev)


static void smc_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
static void smc_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{
{
	strcpy(info->driver, DRV_NAME);
	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
	strcpy(info->version, DRV_VERSION);
	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
}
}


static int smc_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
static int smc_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
+3 −2
Original line number Original line Diff line number Diff line
@@ -185,9 +185,10 @@ static void stmmac_ethtool_getdrvinfo(struct net_device *dev,
	struct stmmac_priv *priv = netdev_priv(dev);
	struct stmmac_priv *priv = netdev_priv(dev);


	if (priv->plat->has_gmac)
	if (priv->plat->has_gmac)
		strcpy(info->driver, GMAC_ETHTOOL_NAME);
		strlcpy(info->driver, GMAC_ETHTOOL_NAME, sizeof(info->driver));
	else
	else
		strcpy(info->driver, MAC100_ETHTOOL_NAME);
		strlcpy(info->driver, MAC100_ETHTOOL_NAME,
			sizeof(info->driver));


	strcpy(info->version, DRV_MODULE_VERSION);
	strcpy(info->version, DRV_MODULE_VERSION);
	info->fw_version[0] = '\0';
	info->fw_version[0] = '\0';
Loading