From patchwork Mon Mar 10 01:01:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 3800941 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D6216BF540 for ; Mon, 10 Mar 2014 01:01:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D397B202EB for ; Mon, 10 Mar 2014 01:01:52 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E951320274 for ; Mon, 10 Mar 2014 01:01:51 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WMobC-0002cB-5d; Mon, 10 Mar 2014 01:01:46 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WMob9-0002yo-Sd; Mon, 10 Mar 2014 01:01:43 +0000 Received: from mail-ea0-x230.google.com ([2a00:1450:4013:c01::230]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WMob7-0002x7-GZ for linux-arm-kernel@lists.infradead.org; Mon, 10 Mar 2014 01:01:42 +0000 Received: by mail-ea0-f176.google.com with SMTP id o10so3392150eaj.7 for ; Sun, 09 Mar 2014 18:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ddB4jvTg5biEdmhhLrAOCMslHUSyal7io+N6TXoN5wc=; b=W8Az25V54IPJLMyWi/WnfE47hJu43IfP4v+mL85LQqjS+qOYRcsr2E5QxOOCOmzHR3 vvnxG9TrmCqyJkA4u44/cKHx2OB+Lh6fB0pm6vle0jf7Mo2hARm2GcypQQ7EJUZT7u7P N+QFrOjpkRgdpSuvbU7XtHtCiz0M9fNzqQ7AgSuKxyULNMQ/JKyewOOTZx3PFpIdxdzC RBdNuV84JsUr1cwQdU65QqScgaqIrBa9u8oBnI7q3WwmAe2lv8QyBq1EfL4+14pEjIYl hR5oS/BfaBpJYeTNkoDN23OM3CsG9XZ9uV6pDG/Nu34Axjc/eaQPNuTBY9+Tn/n1dgL7 i7sA== X-Received: by 10.15.22.65 with SMTP id e41mr31863186eeu.5.1394413279498; Sun, 09 Mar 2014 18:01:19 -0700 (PDT) Received: from topkick.lan (dslc-082-083-251-183.pools.arcor-ip.net. [82.83.251.183]) by mx.google.com with ESMTPSA id m42sm38655416eex.21.2014.03.09.18.01.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Mar 2014 18:01:18 -0700 (PDT) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH] net: phy: fix uninitalized WOL parameters in phy_ethtool_get_wol Date: Mon, 10 Mar 2014 02:01:10 +0100 Message-Id: <1394413270-7169-1-git-send-email-sebastian.hesselbarth@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140309_210141_684993_1D34113A X-CRM114-Status: UNSURE ( 9.63 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) Cc: netdev@vger.kernel.org, Florian Fainelli , David Miller , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP phy_ethtool_get_wol is a helper to get current WOL settings from a phy device. When using this helper on a PHY without .get_wol callback, struct ethtool_wolinfo is never set-up correctly and may contain misleading information about WOL status. To fix this, always zero relevant fields of struct ethtool_wolinfo regardless of .get_wol callback availability. Signed-off-by: Sebastian Hesselbarth Reviewed-by: Florian Fainelli --- Cc: David Miller Cc: Florian Fainelli Cc: netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/net/phy/phy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 19c9eca0ef26..62a7cd401e1c 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -1092,6 +1092,7 @@ EXPORT_SYMBOL(phy_ethtool_set_wol); void phy_ethtool_get_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) { + wol->supported = wol->wolopts = 0; if (phydev->drv->get_wol) phydev->drv->get_wol(phydev, wol); }