Skip to content

Commit

Permalink
usbnet: sanitise overlong driver information strings
Browse files Browse the repository at this point in the history
As seen on smsc75xx, driver_info->description being longer than 32
characters messes up 'ethtool -i' output.

Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Phil Sutter authored and David S. Miller committed Jun 17, 2012
1 parent 0b3f0e7 commit 86a2f41
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/usb/usbnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,9 +876,9 @@ void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
{
struct usbnet *dev = netdev_priv(net);

strncpy (info->driver, dev->driver_name, sizeof info->driver);
strncpy (info->version, DRIVER_VERSION, sizeof info->version);
strncpy (info->fw_version, dev->driver_info->description,
strlcpy (info->driver, dev->driver_name, sizeof info->driver);
strlcpy (info->version, DRIVER_VERSION, sizeof info->version);
strlcpy (info->fw_version, dev->driver_info->description,
sizeof info->fw_version);
usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info);
}
Expand Down

0 comments on commit 86a2f41

Please sign in to comment.