Commit 31a86d13 authored by Eran Ben Elisha's avatar Eran Ben Elisha Committed by David S. Miller
Browse files

net: ethtool: Initialize buffer when querying device channel settings

Ethtool channels respond struct was uninitialized when querying device
channel boundaries settings. As a result, unreported fields by the driver
hold garbage.  This may cause sending unsupported params to driver.

Fixes: 8bf36862

 ('ethtool: ensure channel counts are within bounds ...')
Signed-off-by: default avatarEran Ben Elisha <>
Signed-off-by: default avatarTariq Toukan <>
CC: John W. Linville <>
Signed-off-by: default avatarDavid S. Miller <>
parent 003ecadd
......@@ -1712,7 +1712,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, max;
struct ethtool_channels channels, max = { .cmd = ETHTOOL_GCHANNELS };
u32 max_rx_in_use = 0;
if (!dev->ethtool_ops->set_channels || !dev->ethtool_ops->get_channels)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment