Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2454518imd; Fri, 2 Nov 2018 11:41:06 -0700 (PDT) X-Google-Smtp-Source: AJdET5fdHq4qRUYey+g9VMJorbfF9jaZ4gsqlg8CIbpNuNRxtqHDX8wLw2uG+IyFSl+hR+xObc7O X-Received: by 2002:a17:902:a9c5:: with SMTP id b5-v6mr12699113plr.340.1541184066481; Fri, 02 Nov 2018 11:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184066; cv=none; d=google.com; s=arc-20160816; b=naEnZx1g2o9evvu/Ar0ERMDKrkpTBXyk55LO+RDZniq9+3+1Ko2p0R4o8fOAjvb0Eo ewMk10Jpt2dQaXoMGSzI0jxuAhfsxPlJPzae1ANJwjJsgJT3z/fy2rHqIDE9qIAMXjEt Y911FqZxw/VcExhbQyjvjdQjyB1gdnezJIM7gpFliB7LICQxDeYXR62iN+cTYAyDOhFP 9zD/M5l8L4ZROgqXP4H6B3Jd5Mi06PwYUaZ5GzKyZOdYVAod3HDyhRix78cmggOUKDGU Grnfl3PFpPp6/BaczMA7SBrtKaRiRTcgGY+YWK3hzuwvilCkVA2oplTFy58ES1pJ8Bfp 9Tjg== 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=Pqoe5MWObgwoHiaeD8RPIdUH1g7BOiQk/AMyWNq7ToM=; b=jaf72REU73FUFTn2zlMOz5p2nSk3T27debc2Bywf31e8cmRteaFc9Pr+MwxaFfGXOG THqJqNP/9cv/P61ul7awgI4dqJw1Rf4d0RICADPRzzOIrbKD6YwRItzcJ4XbOE/aV/og nOJL0r0NvxoWMWwiSrmlXD+qILRO/T1BhvgczEoMT0YlYXnmAYWjlO/wO+RtAar8tCcB 0i/L1TmOrjUkisqbU3OIy+F2um0qVzmggOa1y6MK0F1rxkg9hr5fmyaL4TPu51TBIc3j SaaBPLJ301OToLOhOTx7RMzzTQ1lBMOia4XAkQuLoW27ZE0Vl33rlYrF8wOU5lPBHg7t XF8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="TLrAxG/k"; 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 b40-v6si22218530pla.285.2018.11.02.11.40.51; Fri, 02 Nov 2018 11:41:06 -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="TLrAxG/k"; 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 S1729253AbeKCDsF (ORCPT + 99 others); Fri, 2 Nov 2018 23:48:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:42334 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728250AbeKCDsE (ORCPT ); Fri, 2 Nov 2018 23:48:04 -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 BB8042082E; Fri, 2 Nov 2018 18:39:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541183993; bh=8osfBtTS36XT1k6PoJYN/o7GEqwx6c3p1Rn1A+DgKhc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TLrAxG/kA+y7GDao+1AIQPQiDV56lvnv0nEm6n7Iq/hblh2EHoZV7oy5v9Z2i9L2c GLvy8hrZczIunad+stzRPehh20YLCQsF/z/iuV9x+ZlNyKjeBHX3yUgISgEsBQPyw6 FuKSm0mD/J4H6fh3cyFDybssNPXi43umxSP1ntGs= 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 045/150] sr9800: Check for supported Wake-on-LAN modes Date: Fri, 2 Nov 2018 19:33:27 +0100 Message-Id: <20181102182906.567620354@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 c5cb93e994ffb43b7b3b1ff10b9f928f54574a36 ] The driver currently silently accepts unsupported Wake-on-LAN modes (other than WAKE_PHY or WAKE_MAGIC) without reporting that to the user, which is confusing. Fixes: 19a38d8e0aa3 ("USB2NET : SR9800 : One chip USB2.0 USB2NET SR9800 Device Driver Support") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/sr9800.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/sr9800.c b/drivers/net/usb/sr9800.c index 9277a0f228df..35f39f23d881 100644 --- a/drivers/net/usb/sr9800.c +++ b/drivers/net/usb/sr9800.c @@ -421,6 +421,9 @@ sr_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo) struct usbnet *dev = netdev_priv(net); u8 opt = 0; + if (wolinfo->wolopts & ~(WAKE_PHY | WAKE_MAGIC)) + return -EINVAL; + if (wolinfo->wolopts & WAKE_PHY) opt |= SR_MONITOR_LINK; if (wolinfo->wolopts & WAKE_MAGIC) -- 2.17.1