lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200122223326.187954-1-lrizzo@google.com>
Date:   Wed, 22 Jan 2020 14:33:26 -0800
From:   Luigi Rizzo <lrizzo@...gle.com>
To:     netdev@...r.kernel.org
Cc:     "David S. Miller" <davem@...emloft.net>,
        Michal Kubecek <mkubecek@...e.cz>,
        Luigi Rizzo <lrizzo@...gle.com>
Subject: [PATCH] net-core: remove unnecessary ETHTOOL_GCHANNELS initialization

struct ethtool_channels does not need .cmd to be set when calling the
driver's ethtool methods. Just zero-initialize it.

Tested: run ethtool -l and ethtool -L
Signed-off-by: Luigi Rizzo <lrizzo@...gle.com>
---
 net/ethtool/ioctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index 182bffbffa78..92442507a57e 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -1555,7 +1555,7 @@ static int ethtool_set_ringparam(struct net_device *dev, void __user *useraddr)
 static noinline_for_stack int ethtool_get_channels(struct net_device *dev,
 						   void __user *useraddr)
 {
-	struct ethtool_channels channels = { .cmd = ETHTOOL_GCHANNELS };
+	struct ethtool_channels channels = {};
 
 	if (!dev->ethtool_ops->get_channels)
 		return -EOPNOTSUPP;
@@ -1570,7 +1570,7 @@ static noinline_for_stack int ethtool_get_channels(struct net_device *dev,
 static noinline_for_stack int ethtool_set_channels(struct net_device *dev,
 						   void __user *useraddr)
 {
-	struct ethtool_channels channels, curr = { .cmd = ETHTOOL_GCHANNELS };
+	struct ethtool_channels channels, curr = {};
 	u16 from_channel, to_channel;
 	u32 max_rx_in_use = 0;
 	unsigned int i;
-- 
2.25.0.341.g760bfbb309-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ