Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2454550imd; Fri, 2 Nov 2018 11:41:09 -0700 (PDT) X-Google-Smtp-Source: AJdET5fUHyiR//ZzU9f0dZ4qO/OrRNka3E06E+TATtQDmcoCj0af7qaTB1uDmuPtLVW6pi4/iE0K X-Received: by 2002:a62:647:: with SMTP id 68-v6mr3091042pfg.42.1541184069402; Fri, 02 Nov 2018 11:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184069; cv=none; d=google.com; s=arc-20160816; b=jcW1tjz9ZHUVUVJIRHm750qiSbHpA19MAv3ZSE5gyoKOAM7hoZ/mwblBQIHXGDWYD1 m7oK0ICh2Z0RfIAqRSGs50P4bgbZuqt28q7wPhhOGotHSXBGD7Wb9d1FBqoWzVXjHtMY nTh83OQ+YbD/CoWbZNPp++rAnEkDR7I9Oty6T8tJvEOJ+tooTyGc509DW1Q5lGwVSy57 HvyeHRl71VYxR2LmICUteVJp7hrdzOSjY8Z+RFNBR9aCBoDDEu2UOSOGCw74CZosecs3 cDTwSXhNQWMwM9KeUQoGBvnu6fUrSVaNQY4dSQzFf4qxyk1GqhnAz5LqeC1p7Jo/oUso UWOw== 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=9ZXAdV8WeobC8ZGivXM0m8vwCaVP797Hfkem0lWHPPg=; b=RmPAbzjb68/c3EdJJpsPAeauq6O/Dn4OdL2Gg2jYRGL7Qm4iPlobqHO2fbW8AtYCrh YaWEdxYkTMQbZgmNEvSy4w1F4NqSsheaIgMzCq/MghXGkdhBpA9Vshrn7tHL9FHOOlji /Cm1VWZl3hqnWnhAKNyyOXDYNLi9NzXc1eZh0P36fHG+o5X9uGazWOrYJuoaqleKQsUk I4EN77fVNXblf51L6qqbEpS9EsYMUCJ0ryZPslc3tvvIenw+5NvJLVFZuNcfS/X83HB+ x1SamlTp9mZhHtos/IdDDs8raFFJPfH7bUb9Kn9tTori18scDMDl18GygrU50MNY1umY DqEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=npSC2wpz; 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 134-v6si35017272pfu.273.2018.11.02.11.40.54; Fri, 02 Nov 2018 11:41:09 -0700 (PDT) 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=npSC2wpz; 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 S1729298AbeKCDsO (ORCPT + 99 others); Fri, 2 Nov 2018 23:48:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:42568 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728250AbeKCDsN (ORCPT ); Fri, 2 Nov 2018 23:48:13 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 CDCB12082E; Fri, 2 Nov 2018 18:40:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184002; bh=uZ3S2s44QCI+ZyUTo+rA+TDK2mYbt+R2jmz21U0M0B4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=npSC2wpzbe337frP2y9fQqgCu7s5i4gUlMdlrqIKKoio9UpwCkxB/lRIlzQRcCmla g9ePxR4bmHnfNAuwxmpSKKwwV56eYHXhiri1sjjjj2HiDXkV3qEgPHEPRLXF1q5iOg dlxWKMgnL2t5UM5kFK1wGQZcNj3EkykbYSksZefw= 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.18 048/150] smsc95xx: Check for Wake-on-LAN modes Date: Fri, 2 Nov 2018 19:33:30 +0100 Message-Id: <20181102182906.821453549@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@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.18-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 06b4d290784d..262e7a3c23cb 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -774,6 +774,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