From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Subject: [PATCH] ethtool: zero initialize coalesce struct Date: Fri, 14 Dec 2018 17:19:23 -0800 Message-ID: <20181215011923.246179-1-zenczykowski@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: "David S . Miller" , David Decotigny , netdev@vger.kernel.org To: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= , Jeff Garzik , Ben Hutchings Return-path: Received: from mail-pg1-f196.google.com ([209.85.215.196]:43297 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726448AbeLOBTd (ORCPT ); Fri, 14 Dec 2018 20:19:33 -0500 Received: by mail-pg1-f196.google.com with SMTP id v28so3436697pgk.10 for ; Fri, 14 Dec 2018 17:19:32 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: From: Maciej Żenczykowski prior to fetching it from kernel. Otherwise we run the risk of very tail portion of it (dmac field) being left entirely uninitialized, and likely containing some sort of stale data. It seems to likely be some sort of time (a second's counter). Tested: 'ethtool -c eth1' with old kernel now reports 'dmac: 0' where previously it reported some sort of second counter. Signed-off-by: Maciej Żenczykowski --- ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethtool.c b/ethtool.c index 2f7e96bb58db..465eeecb9318 100644 --- a/ethtool.c +++ b/ethtool.c @@ -2076,7 +2076,7 @@ static int do_gchannels(struct cmd_context *ctx) static int do_gcoalesce(struct cmd_context *ctx) { - struct ethtool_coalesce ecoal; + struct ethtool_coalesce ecoal = {}; int err; if (ctx->argc != 0) -- 2.20.0.405.gbc1bbc6f85-goog