Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp51353imu; Thu, 8 Nov 2018 14:36:26 -0800 (PST) X-Google-Smtp-Source: AJdET5eBrkXMLMB0pTCoFS02nRFv9IhdFSGZKGyxK9SE5gisxxzXXeEEmtUQGWOgt552H9uTxwMi X-Received: by 2002:a17:902:6686:: with SMTP id e6-v6mr6318019plk.173.1541716586294; Thu, 08 Nov 2018 14:36:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716586; cv=none; d=google.com; s=arc-20160816; b=o9GtTdHSedpTOve5A/BB7YnY6ecahTKECca9xcrwN1E88Y6AcFej0YYGKyFty2siLV +6RJyDCLkoMCcxsDxPM0Ic7AIeoqxlHYZgF/6UjU3c1RwE2AOdZDrubmUW9as6EzXDSL Wono7tsQnWQHaotAxLbMrm65caYv8xANzfMOJPmGLwbXCrgjFtY1S5EqHfMGpJhJg0Wn 9h9FkiL1VCWbZl+i+8CyvrSLmIGyDveWi37i7nKKgc4ndDgqexEetxvVM7wH+xrVP78Y o+sffqn77dDtaIYudZ7j1QqzPoHqX3CNY8JVeTljbAM9C3I3GYCToHkl3R3/DoALyymj bdlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aquLoMWDVefnCQ5wplEqh15MB5SeNEg+i7XZk/7J2N8=; b=gurNlupp3RemZjNvavjRkQbIg1droCyUDjRyEY4Tt+GJ/a6J0Cejn/l/rX/slM7vzF oauTqo8vSxxZfmB5ZzzezM7/EJ6JvYPyEmAO+64kb/Lp1A1pDMlb8A9zaMmQ74EcxRp+ EunT9N7/6RHnnOOvqtxiNthaTBPRkimt1kJTESxxDRAaZybZxDNSLcGztFbldxgBWcon +MMle0CaiAY4E9jf3q0232sBJ74789PtB+OqPnghdSYkGIoyfot2ZqCbDR2IAjStd7xk HgxOg19/6TbNHS0scz+Uw1WFdd2Ry97k7yMLJbeVJkw2r0qPeqjU4A233vNCMJQlsC3r NLFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rNCFSNEj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u10-v6si5352303pls.307.2018.11.08.14.36.10; Thu, 08 Nov 2018 14:36:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rNCFSNEj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730054AbeKIHhE (ORCPT + 99 others); Fri, 9 Nov 2018 02:37:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:54722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728724AbeKIHg7 (ORCPT ); Fri, 9 Nov 2018 02:36:59 -0500 Received: from localhost (unknown [208.72.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 550D020989; Thu, 8 Nov 2018 21:59:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714371; bh=EIlcazQBV/H/KNr8H1ywpxQG0RszHI5VwZBtjB/oWto=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rNCFSNEjG17DP8ZiyInld+t2uAG69HmqsOH8v5qaU0f1XNvDfOOphPKGAt5LEfxPC e5CphWEIFN3Wf1bImctXcaEsgRGAK8jiekpScbyKTunSMAVS/6hu6kAKZel+BKDCm9 UU2lwctJLa4dTlPbaseU9f1fchYwSwMSOCMYX4og= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 016/114] smsc95xx: Check for Wake-on-LAN modes Date: Thu, 8 Nov 2018 13:50:31 -0800 Message-Id: <20181108215100.645804003@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215059.051093652@linuxfoundation.org> References: <20181108215059.051093652@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit c530c471ba37bdd9fe1c7185b01455c00ae606fb ] The driver does not check for Wake-on-LAN modes specified by an user, but will conditionally set the device as wake-up enabled or not based on that, which could be a very confusing user experience. Fixes: e0e474a83c18 ("smsc95xx: add wol magic packet support") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/smsc95xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 66b3ab9f614e..7cee7777d13f 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -727,6 +727,9 @@ static int smsc95xx_ethtool_set_wol(struct net_device *net, struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); int ret; + if (wolinfo->wolopts & ~SUPPORTED_WAKE) + return -EINVAL; + pdata->wolopts = wolinfo->wolopts & SUPPORTED_WAKE; ret = device_set_wakeup_enable(&dev->udev->dev, pdata->wolopts); -- 2.17.1