Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2454540imd; Fri, 2 Nov 2018 11:41:08 -0700 (PDT) X-Google-Smtp-Source: AJdET5fzObY3zqkLBeQh8a5+dZuK75igJFhWy1C2gdwac14KOkCAlx1JWEKcnva82YgeG1xIjSyP X-Received: by 2002:a65:5a05:: with SMTP id y5-v6mr11831462pgs.161.1541184068875; Fri, 02 Nov 2018 11:41:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184068; cv=none; d=google.com; s=arc-20160816; b=kF3cq3df8+zf4No/wXhdzfyMh387QhjC/o8WfmpTvbItPg0MHhZp2k+A2Vgy5vJYcg f1895M6sD0CA1iTIcP0ctEmMYf2AorxgeYvv1E24xBvt19W8BB5r6jYH1Nvm1ebjtesS hR5ZerMTjx7a2rMbXFAI4sl2HIPUAxZv5IbOHNE/WiwnqptfXavTD7WxQ+3Pj3WfrR/A tba7WmSVLcKijWuI/VgGli8rQVe8yT+lEKbzPOTrJLVQrDsigjpyBe8x15IPUICHGWai TTn6pw2Xs8uXwIFStBCcNSQQIU5Fs/Rn6YGz1KU5lVIPGCOdPhQiUo/JdXPOd1909X1S SnLg== 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=SkWmalYqaGdB4a+gSjN5/D89Pv4RWHQIOuqSM5bg/T4=; b=qUFrPI5xBeA4NkXovRScvyvcaZnajv86ZxhnrUijg77TR1STVMTgFFNCR8bsTI7x4g Y2Sv2A2G9Rp2Q3Q0dySoV9G37ooICdPWhbGM2JR0SnGL3kOOpamHPtlijsq3qdC7rgx0 v5PmPP5p1OFudycbROd30nQaUTkSeSO1yjkeTT9w12PW3u7FTp2s9e8S2SKj8ZAQjBuc fVBdk/Dw77DhBWzsiQcX7feX0PEQ7dX1pTbYW/xxD3IPp8SA+yu9OTgH7Gl/XVMRRibB hJjD0h6Cfmfkh5J6u75nuRlToPvPtoKwtz1Fsmtm2YXSCdiXL5Twar2Ja1BPwLMTV5tF bXGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Mu7ZO+59; 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 d16-v6si35324950pgd.555.2018.11.02.11.40.54; Fri, 02 Nov 2018 11:41:08 -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=Mu7ZO+59; 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 S1729283AbeKCDsL (ORCPT + 99 others); Fri, 2 Nov 2018 23:48:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:42474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728250AbeKCDsK (ORCPT ); Fri, 2 Nov 2018 23:48:10 -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 91EDB2082E; Fri, 2 Nov 2018 18:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541183999; bh=ZLpDGhYpIWWUx5wZjNdoQHg3bUT0Hk8zf/EZJcLzj0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mu7ZO+59w1XoL6/Rts5pyjkfMjSQelr2SKGbbsEw5yGvP/DJkyBydN42X0rfkIFKE 3KZb3tkBePmX2PZKuXLZa2Q3L+u5u3cFUCyn/pwcLffe8K/IU/KypvqqIINxaEQpw/ 04nfEkjDMnzOBX2r/pWEgc49r8oa3rzMij/b8yQg= 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 047/150] smsc75xx: Check for Wake-on-LAN modes Date: Fri, 2 Nov 2018 19:33:29 +0100 Message-Id: <20181102182906.739322815@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 9c734b2769a73eea2e9e9767c0e0bf839ff23679 ] 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: 6c636503260d ("smsc75xx: add wol magic packet support") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/smsc75xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index b64b1ee56d2d..ec287c9741e8 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c @@ -731,6 +731,9 @@ static int smsc75xx_ethtool_set_wol(struct net_device *net, struct smsc75xx_priv *pdata = (struct smsc75xx_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