From patchwork Fri Mar 14 09:07:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 3831381 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 C68CCBF540 for ; Fri, 14 Mar 2014 09:08:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0B3220328 for ; Fri, 14 Mar 2014 09:08:31 +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 4287B202E9 for ; Fri, 14 Mar 2014 09:08:27 +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 1WOO6I-00012d-Jj; Fri, 14 Mar 2014 09:08:22 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOO6G-0004eJ-7Y; Fri, 14 Mar 2014 09:08:20 +0000 Received: from mail-ee0-x22b.google.com ([2a00:1450:4013:c00::22b]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOO6D-0004d0-7X for linux-arm-kernel@lists.infradead.org; Fri, 14 Mar 2014 09:08:18 +0000 Received: by mail-ee0-f43.google.com with SMTP id e53so1094050eek.16 for ; Fri, 14 Mar 2014 02:07:55 -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:in-reply-to:references; bh=z9rTDtMca/WMk03FNZKbkU5CUgp1xMKkJFbIuO9aS5U=; b=h68ggQNM7IEIjA8i8K9LAfjCDApsuptWvPk2cGsc+Kkw+SN4L1Sx5T5SZRCMrqNI3w 9C58zgjN5g5AhGJGEIa5pLkz0gH61u4+ycPd5CDzr7Q4owopzMgfnoy7Ksq4BIi9S/dr SwgrWriU9UrHTXSa2s8eg0CE0fd9YikM/yvF/3xqj0aV4wL5vUDE1hYX9azMALxxPeO0 8yaGVISzVv8ikMnizpxa+MSkwukTFeyc/EavvCQgAbAT8lriqMoK56q8I4i4+bUpnm04 mI22xp8z436QY0N91sS+OsBDt6KR39lU3VM/IGcW9909M/WK3Gyj5CoKjlN4iCG2J7N7 z85A== X-Received: by 10.15.51.1 with SMTP id m1mr7207134eew.25.1394788074991; Fri, 14 Mar 2014 02:07:54 -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 m1sm15777777een.7.2014.03.14.02.07.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Mar 2014 02:07:54 -0700 (PDT) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH] net: phy: fix uninitalized ethtool_wolinfo in phy_suspend Date: Fri, 14 Mar 2014 10:07:44 +0100 Message-Id: <1394788064-6832-1-git-send-email-sebastian.hesselbarth@gmail.com> In-Reply-To: <20140313.153832.967564223480298567.davem@davemloft.net> References: <20140313.153832.967564223480298567.davem@davemloft.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140314_050817_434600_89F495E9 X-CRM114-Status: GOOD ( 11.55 ) X-Spam-Score: -2.0 (--) Cc: Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Ben Hutchings , David Miller , linux-arm-kernel@lists.infradead.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=unavailable 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 Callers of phy_ethtool_get_wol are supposed to provide a properly cleared struct ethtool_wolinfo. Therefore, fix phy_suspend to clear it before passing it to phy_ethtool_get_wol. Signed-off-by: Sebastian Hesselbarth Reviewed-by: Ben Hutchings --- Cc: David Miller Cc: Florian Fainelli Cc: Ben Hutchings Cc: netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/net/phy/phy_device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 4b03e63639b7..7512e28866f1 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -683,10 +683,9 @@ EXPORT_SYMBOL(phy_detach); int phy_suspend(struct phy_device *phydev) { struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver); - struct ethtool_wolinfo wol; + struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL }; /* If the device has WOL enabled, we cannot suspend the PHY */ - wol.cmd = ETHTOOL_GWOL; phy_ethtool_get_wol(phydev, &wol); if (wol.wolopts) return -EBUSY;