Skip to content

Commit

Permalink
net: move from strlcpy with unused retval to strscpy
Browse files Browse the repository at this point in the history
Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> # for CAN
Link: https://lore.kernel.org/r/20220830201457.7984-1-wsa+renesas@sang-engineering.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Wolfram Sang authored and kuba-moo committed Aug 31, 2022
1 parent 8af1a9a commit fb3ceec
Show file tree
Hide file tree
Showing 40 changed files with 75 additions and 75 deletions.
2 changes: 1 addition & 1 deletion drivers/net/Space.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static int netdev_boot_setup_add(char *name, struct ifmap *map)
for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) {
if (s[i].name[0] == '\0' || s[i].name[0] == ' ') {
memset(s[i].name, 0, sizeof(s[i].name));
strlcpy(s[i].name, name, IFNAMSIZ);
strscpy(s[i].name, name, IFNAMSIZ);
memcpy(&s[i].map, map, sizeof(s[i].map));
break;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5619,7 +5619,7 @@ static int bond_ethtool_get_link_ksettings(struct net_device *bond_dev,
static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
struct ethtool_drvinfo *drvinfo)
{
strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
strscpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "%d",
BOND_ABI_VERSION);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/can/sja1000/peak_pcmcia.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ static void pcan_free_channels(struct pcan_pccard *card)
if (!netdev)
continue;

strlcpy(name, netdev->name, IFNAMSIZ);
strscpy(name, netdev->name, IFNAMSIZ);

unregister_sja1000dev(netdev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/can/usb/peak_usb/pcan_usb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ static void peak_usb_disconnect(struct usb_interface *intf)

dev_prev_siblings = dev->prev_siblings;
dev->state &= ~PCAN_USB_STATE_CONNECTED;
strlcpy(name, netdev->name, IFNAMSIZ);
strscpy(name, netdev->name, IFNAMSIZ);

unregister_netdev(netdev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dsa/b53/b53_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ void b53_get_strings(struct dsa_switch *ds, int port, u32 stringset,

if (stringset == ETH_SS_STATS) {
for (i = 0; i < mib_size; i++)
strlcpy(data + i * ETH_GSTRING_LEN,
strscpy(data + i * ETH_GSTRING_LEN,
mibs[i].name, ETH_GSTRING_LEN);
} else if (stringset == ETH_SS_PHY_STATS) {
phydev = b53_get_phy_device(ds, port);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dsa/bcm_sf2_cfp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ void bcm_sf2_cfp_get_strings(struct dsa_switch *ds, int port,
"CFP%03d_%sCntr",
i, bcm_sf2_cfp_stats[j].name);
iter = (i - 1) * s + j;
strlcpy(data + iter * ETH_GSTRING_LEN,
strscpy(data + iter * ETH_GSTRING_LEN,
buf, ETH_GSTRING_LEN);
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dsa/hirschmann/hellcreek.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static void hellcreek_get_strings(struct dsa_switch *ds, int port,
for (i = 0; i < ARRAY_SIZE(hellcreek_counter); ++i) {
const struct hellcreek_counter *counter = &hellcreek_counter[i];

strlcpy(data + i * ETH_GSTRING_LEN,
strscpy(data + i * ETH_GSTRING_LEN,
counter->name, ETH_GSTRING_LEN);
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dsa/mv88e6xxx/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ static void mv88e6xxx_atu_vtu_get_strings(uint8_t *data)
unsigned int i;

for (i = 0; i < ARRAY_SIZE(mv88e6xxx_atu_vtu_stats_strings); i++)
strlcpy(data + i * ETH_GSTRING_LEN,
strscpy(data + i * ETH_GSTRING_LEN,
mv88e6xxx_atu_vtu_stats_strings[i],
ETH_GSTRING_LEN);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static const struct net_device_ops dummy_netdev_ops = {
static void dummy_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{
strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
strscpy(info->driver, DRV_NAME, sizeof(info->driver));
}

static const struct ethtool_ops dummy_ethtool_ops = {
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/fjes/fjes_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ static void fjes_get_drvinfo(struct net_device *netdev,

plat_dev = adapter->plat_dev;

strlcpy(drvinfo->driver, fjes_driver_name, sizeof(drvinfo->driver));
strlcpy(drvinfo->version, fjes_driver_version,
strscpy(drvinfo->driver, fjes_driver_name, sizeof(drvinfo->driver));
strscpy(drvinfo->version, fjes_driver_version,
sizeof(drvinfo->version));

strlcpy(drvinfo->fw_version, "none", sizeof(drvinfo->fw_version));
strscpy(drvinfo->fw_version, "none", sizeof(drvinfo->fw_version));
snprintf(drvinfo->bus_info, sizeof(drvinfo->bus_info),
"platform:%s", plat_dev->name);
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/geneve.c
Original file line number Diff line number Diff line change
Expand Up @@ -1197,8 +1197,8 @@ static const struct net_device_ops geneve_netdev_ops = {
static void geneve_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *drvinfo)
{
strlcpy(drvinfo->version, GENEVE_NETDEV_VER, sizeof(drvinfo->version));
strlcpy(drvinfo->driver, "geneve", sizeof(drvinfo->driver));
strscpy(drvinfo->version, GENEVE_NETDEV_VER, sizeof(drvinfo->version));
strscpy(drvinfo->driver, "geneve", sizeof(drvinfo->driver));
}

static const struct ethtool_ops geneve_ethtool_ops = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/hamradio/hdlcdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ static int hdlcdrv_siocdevprivate(struct net_device *dev, struct ifreq *ifr,

case HDLCDRVCTL_DRIVERNAME:
if (s->ops && s->ops->drvname) {
strlcpy(bi.data.drivername, s->ops->drvname,
strscpy(bi.data.drivername, s->ops->drvname,
sizeof(bi.data.drivername));
break;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/hyperv/netvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -935,8 +935,8 @@ int netvsc_recv_callback(struct net_device *net,
static void netvsc_get_drvinfo(struct net_device *net,
struct ethtool_drvinfo *info)
{
strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
strlcpy(info->fw_version, "N/A", sizeof(info->fw_version));
strscpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
strscpy(info->fw_version, "N/A", sizeof(info->fw_version));
}

static void netvsc_get_channels(struct net_device *net,
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ipvlan/ipvlan_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ static int ipvlan_ethtool_get_link_ksettings(struct net_device *dev,
static void ipvlan_ethtool_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *drvinfo)
{
strlcpy(drvinfo->driver, IPVLAN_DRV, sizeof(drvinfo->driver));
strlcpy(drvinfo->version, IPV_DRV_VER, sizeof(drvinfo->version));
strscpy(drvinfo->driver, IPVLAN_DRV, sizeof(drvinfo->driver));
strscpy(drvinfo->version, IPV_DRV_VER, sizeof(drvinfo->version));
}

static u32 ipvlan_ethtool_get_msglevel(struct net_device *dev)
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,8 +1043,8 @@ static int macvlan_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
static void macvlan_ethtool_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *drvinfo)
{
strlcpy(drvinfo->driver, "macvlan", sizeof(drvinfo->driver));
strlcpy(drvinfo->version, "0.1", sizeof(drvinfo->version));
strscpy(drvinfo->driver, "macvlan", sizeof(drvinfo->driver));
strscpy(drvinfo->version, "0.1", sizeof(drvinfo->version));
}

static int macvlan_ethtool_get_link_ksettings(struct net_device *dev,
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/net_failover.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ static const struct net_device_ops failover_dev_ops = {
static void nfo_ethtool_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *drvinfo)
{
strlcpy(drvinfo->driver, FAILOVER_NAME, sizeof(drvinfo->driver));
strlcpy(drvinfo->version, FAILOVER_VERSION, sizeof(drvinfo->version));
strscpy(drvinfo->driver, FAILOVER_NAME, sizeof(drvinfo->driver));
strscpy(drvinfo->version, FAILOVER_VERSION, sizeof(drvinfo->version));
}

static int nfo_ethtool_get_link_ksettings(struct net_device *dev,
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/netconsole.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ MODULE_PARM_DESC(oops_only, "Only log oops messages");
#ifndef MODULE
static int __init option_setup(char *opt)
{
strlcpy(config, opt, MAX_PARAM_LENGTH);
strscpy(config, opt, MAX_PARAM_LENGTH);
return 1;
}
__setup("netconsole=", option_setup);
Expand Down Expand Up @@ -178,7 +178,7 @@ static struct netconsole_target *alloc_param_target(char *target_config)
goto fail;

nt->np.name = "netconsole";
strlcpy(nt->np.dev_name, "eth0", IFNAMSIZ);
strscpy(nt->np.dev_name, "eth0", IFNAMSIZ);
nt->np.local_port = 6665;
nt->np.remote_port = 6666;
eth_broadcast_addr(nt->np.remote_mac);
Expand Down Expand Up @@ -414,7 +414,7 @@ static ssize_t dev_name_store(struct config_item *item, const char *buf,
return -EINVAL;
}

strlcpy(nt->np.dev_name, buf, IFNAMSIZ);
strscpy(nt->np.dev_name, buf, IFNAMSIZ);

/* Get rid of possible trailing newline from echo(1) */
len = strnlen(nt->np.dev_name, IFNAMSIZ);
Expand Down Expand Up @@ -630,7 +630,7 @@ static struct config_item *make_netconsole_target(struct config_group *group,
return ERR_PTR(-ENOMEM);

nt->np.name = "netconsole";
strlcpy(nt->np.dev_name, "eth0", IFNAMSIZ);
strscpy(nt->np.dev_name, "eth0", IFNAMSIZ);
nt->np.local_port = 6665;
nt->np.remote_port = 6666;
eth_broadcast_addr(nt->np.remote_mac);
Expand Down Expand Up @@ -708,7 +708,7 @@ static int netconsole_netdev_event(struct notifier_block *this,
if (nt->np.dev == dev) {
switch (event) {
case NETDEV_CHANGENAME:
strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ);
strscpy(nt->np.dev_name, dev->name, IFNAMSIZ);
break;
case NETDEV_RELEASE:
case NETDEV_JOIN:
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/ntb_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,9 @@ static void ntb_get_drvinfo(struct net_device *ndev,
{
struct ntb_netdev *dev = netdev_priv(ndev);

strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
strlcpy(info->version, NTB_NETDEV_VER, sizeof(info->version));
strlcpy(info->bus_info, pci_name(dev->pdev), sizeof(info->bus_info));
strscpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
strscpy(info->version, NTB_NETDEV_VER, sizeof(info->version));
strscpy(info->bus_info, pci_name(dev->pdev), sizeof(info->bus_info));
}

static int ntb_get_link_ksettings(struct net_device *dev,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/phy/adin.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ static void adin_get_strings(struct phy_device *phydev, u8 *data)
int i;

for (i = 0; i < ARRAY_SIZE(adin_hw_stats); i++) {
strlcpy(&data[i * ETH_GSTRING_LEN],
strscpy(&data[i * ETH_GSTRING_LEN],
adin_hw_stats[i].string, ETH_GSTRING_LEN);
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/phy/bcm-phy-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ void bcm_phy_get_strings(struct phy_device *phydev, u8 *data)
unsigned int i;

for (i = 0; i < ARRAY_SIZE(bcm_phy_hw_stats); i++)
strlcpy(data + i * ETH_GSTRING_LEN,
strscpy(data + i * ETH_GSTRING_LEN,
bcm_phy_hw_stats[i].string, ETH_GSTRING_LEN);
}
EXPORT_SYMBOL_GPL(bcm_phy_get_strings);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/phy/marvell.c
Original file line number Diff line number Diff line change
Expand Up @@ -1952,7 +1952,7 @@ static void marvell_get_strings(struct phy_device *phydev, u8 *data)
int i;

for (i = 0; i < count; i++) {
strlcpy(data + i * ETH_GSTRING_LEN,
strscpy(data + i * ETH_GSTRING_LEN,
marvell_hw_stats[i].string, ETH_GSTRING_LEN);
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/phy/micrel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,7 @@ static void kszphy_get_strings(struct phy_device *phydev, u8 *data)
int i;

for (i = 0; i < ARRAY_SIZE(kszphy_hw_stats); i++) {
strlcpy(data + i * ETH_GSTRING_LEN,
strscpy(data + i * ETH_GSTRING_LEN,
kszphy_hw_stats[i].string, ETH_GSTRING_LEN);
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/phy/mscc/mscc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static void vsc85xx_get_strings(struct phy_device *phydev, u8 *data)
return;

for (i = 0; i < priv->nstats; i++)
strlcpy(data + i * ETH_GSTRING_LEN, priv->hw_stats[i].string,
strscpy(data + i * ETH_GSTRING_LEN, priv->hw_stats[i].string,
ETH_GSTRING_LEN);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
if (!fixup)
return -ENOMEM;

strlcpy(fixup->bus_id, bus_id, sizeof(fixup->bus_id));
strscpy(fixup->bus_id, bus_id, sizeof(fixup->bus_id));
fixup->phy_uid = phy_uid;
fixup->phy_uid_mask = phy_uid_mask;
fixup->run = run;
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/rionet.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,10 @@ static void rionet_get_drvinfo(struct net_device *ndev,
{
struct rionet_private *rnet = netdev_priv(ndev);

strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
strlcpy(info->version, DRV_VERSION, sizeof(info->version));
strlcpy(info->fw_version, "n/a", sizeof(info->fw_version));
strlcpy(info->bus_info, rnet->mport->name, sizeof(info->bus_info));
strscpy(info->driver, DRV_NAME, sizeof(info->driver));
strscpy(info->version, DRV_VERSION, sizeof(info->version));
strscpy(info->fw_version, "n/a", sizeof(info->fw_version));
strscpy(info->bus_info, rnet->mport->name, sizeof(info->bus_info));
}

static u32 rionet_get_msglevel(struct net_device *ndev)
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/team/team.c
Original file line number Diff line number Diff line change
Expand Up @@ -2070,8 +2070,8 @@ static const struct net_device_ops team_netdev_ops = {
static void team_ethtool_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *drvinfo)
{
strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
strlcpy(drvinfo->version, UTS_RELEASE, sizeof(drvinfo->version));
strscpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
strscpy(drvinfo->version, UTS_RELEASE, sizeof(drvinfo->version));
}

static int team_ethtool_get_link_ksettings(struct net_device *dev,
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -3540,15 +3540,15 @@ static void tun_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info
{
struct tun_struct *tun = netdev_priv(dev);

strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
strlcpy(info->version, DRV_VERSION, sizeof(info->version));
strscpy(info->driver, DRV_NAME, sizeof(info->driver));
strscpy(info->version, DRV_VERSION, sizeof(info->version));

switch (tun->flags & TUN_TYPE_MASK) {
case IFF_TUN:
strlcpy(info->bus_info, "tun", sizeof(info->bus_info));
strscpy(info->bus_info, "tun", sizeof(info->bus_info));
break;
case IFF_TAP:
strlcpy(info->bus_info, "tap", sizeof(info->bus_info));
strscpy(info->bus_info, "tap", sizeof(info->bus_info));
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/aqc111.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static void aqc111_get_drvinfo(struct net_device *net,

/* Inherit standard device info */
usbnet_get_drvinfo(net, info);
strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
strscpy(info->driver, DRIVER_NAME, sizeof(info->driver));
snprintf(info->fw_version, sizeof(info->fw_version), "%u.%u.%u",
aqc111_data->fw_ver.major,
aqc111_data->fw_ver.minor,
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/usb/asix_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,8 @@ void asix_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info)
{
/* Inherit standard device info */
usbnet_get_drvinfo(net, info);
strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
strscpy(info->driver, DRIVER_NAME, sizeof(info->driver));
strscpy(info->version, DRIVER_VERSION, sizeof(info->version));
}

int asix_set_mac_address(struct net_device *net, void *p)
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/usb/catc.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,8 @@ static void catc_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{
struct catc *catc = netdev_priv(dev);
strlcpy(info->driver, driver_name, sizeof(info->driver));
strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
strscpy(info->driver, driver_name, sizeof(info->driver));
strscpy(info->version, DRIVER_VERSION, sizeof(info->version));
usb_make_path(catc->usbdev, info->bus_info, sizeof(info->bus_info));
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/pegasus.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ static void pegasus_get_drvinfo(struct net_device *dev,
{
pegasus_t *pegasus = netdev_priv(dev);

strlcpy(info->driver, driver_name, sizeof(info->driver));
strscpy(info->driver, driver_name, sizeof(info->driver));
usb_make_path(pegasus->usb, info->bus_info, sizeof(info->bus_info));
}

Expand Down
6 changes: 3 additions & 3 deletions drivers/net/usb/r8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -8602,11 +8602,11 @@ static void rtl8152_get_drvinfo(struct net_device *netdev,
{
struct r8152 *tp = netdev_priv(netdev);

strlcpy(info->driver, MODULENAME, sizeof(info->driver));
strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
strscpy(info->driver, MODULENAME, sizeof(info->driver));
strscpy(info->version, DRIVER_VERSION, sizeof(info->version));
usb_make_path(tp->udev, info->bus_info, sizeof(info->bus_info));
if (!IS_ERR_OR_NULL(tp->rtl_fw.fw))
strlcpy(info->fw_version, tp->rtl_fw.version,
strscpy(info->fw_version, tp->rtl_fw.version,
sizeof(info->fw_version));
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/usb/rtl8150.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,8 @@ static void rtl8150_get_drvinfo(struct net_device *netdev, struct ethtool_drvinf
{
rtl8150_t *dev = netdev_priv(netdev);

strlcpy(info->driver, driver_name, sizeof(info->driver));
strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
strscpy(info->driver, driver_name, sizeof(info->driver));
strscpy(info->version, DRIVER_VERSION, sizeof(info->version));
usb_make_path(dev->udev, info->bus_info, sizeof(info->bus_info));
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/usb/sierra_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ static void sierra_net_get_drvinfo(struct net_device *net,
{
/* Inherit standard device info */
usbnet_get_drvinfo(net, info);
strlcpy(info->driver, driver_name, sizeof(info->driver));
strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
strscpy(info->driver, driver_name, sizeof(info->driver));
strscpy(info->version, DRIVER_VERSION, sizeof(info->version));
}

static u32 sierra_net_get_link(struct net_device *net)
Expand Down

0 comments on commit fb3ceec

Please sign in to comment.