Search Linux Wireless

[PATCH 11/26] at76_usb: Stop worrying about line termination in ethtool info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The driver's responsibility is not to overwrite the buffer and not to
leak kernel data.  Line termination is the userspace responsibility.

Signed-off-by: Pavel Roskin <proski@xxxxxxx>
---

 drivers/net/wireless/at76_usb.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)


diff --git a/drivers/net/wireless/at76_usb.c b/drivers/net/wireless/at76_usb.c
index b6f931a..2bb23e8 100644
--- a/drivers/net/wireless/at76_usb.c
+++ b/drivers/net/wireless/at76_usb.c
@@ -3322,14 +3322,12 @@ static void at76_ethtool_get_drvinfo(struct net_device *netdev,
 {
 	struct at76_priv *priv = netdev_priv(netdev);
 
-	strncpy(info->driver, DRIVER_NAME, sizeof(info->driver) - 1);
-
+	strncpy(info->driver, DRIVER_NAME, sizeof(info->driver));
 	strncpy(info->version, DRIVER_VERSION, sizeof(info->version));
-	info->version[sizeof(info->version) - 1] = '\0';
 
 	usb_make_path(priv->udev, info->bus_info, sizeof(info->bus_info));
 
-	snprintf(info->fw_version, sizeof(info->fw_version) - 1, "%d.%d.%d-%d",
+	snprintf(info->fw_version, sizeof(info->fw_version), "%d.%d.%d-%d",
 		 priv->fw_version.major, priv->fw_version.minor,
 		 priv->fw_version.patch, priv->fw_version.build);
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux