Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp52026imu; Thu, 8 Nov 2018 14:37:16 -0800 (PST) X-Google-Smtp-Source: AJdET5dt/XxIUxeL0Sc9HggIiBk0L/v2k4nbo+vs1vklP9heXKFyCkN1hcjqEitVOlc8dqDaHB+3 X-Received: by 2002:a62:449b:: with SMTP id m27-v6mr6434958pfi.82.1541716636188; Thu, 08 Nov 2018 14:37:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716636; cv=none; d=google.com; s=arc-20160816; b=CjegWOtIxFFlP/tg+glOb+rGpjNNI7sup/hH61j1N7M0iuCfUxS8niy5N7fhNayMMD jzI8jC2uddmlXPEuswcdghPs0NTOK48PRnjafcvkx0bbGKCzU3Y93BkHqTa4ScL+s1aF nLUD1ei7xpQj/QP1/KIkMMIPMHYI9BtppfiOSvLvw7p4qHRPWwGgE/1JjPmhYCCCoe2H 3OJgdxKqeVWTEkz4XY2o1hqWZX4P98gz17yf76CZcCmwZI/750ty0E8X1h/J0oji3BTM 2o6MwsHUhV5giraqzjxNo++qGmqPuQJDQ6oXJ5hgwx+tDOCyBFuSll9OE9A5T4nEg+mE kdBQ== 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=6EOGRxNYKnhErb83e/95lQAi5MBFUa80W8MUKm+ThFc=; b=KJvW5XzLz1VgK6+Bcn6ay37VWp4GfmybDtPwP0fmQ4HmgZUVFsFrK6+vbVRgnQGv21 uA/J0gaI4xSGGs8hTgtd3UMpkXK5W3VMdBOHtV+uHmYhGmuNuBLf0tS9eIDMWqW06OA7 K25kAS3S5UZU08pWVpsdnPZcOSBf3TaEt3MwjL+3jUtEwnsr+T38fecMj6lmf5JKAC4s J0833gbLbgZPoy/ef8GRrNPDbA1nsNJi/2nw5NoMjKGs9kxX/wl31IdxSIM5yD1GOI6x QUU4SHrIEinttZw3vOat/k0ZsPiAHgQUpmsto0DkfUvVk21xXxIF8SDJNZ+B5DILNxjD FjQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DUx0Jhp1; 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 bg12-v6si5357988plb.319.2018.11.08.14.37.00; Thu, 08 Nov 2018 14:37:16 -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=DUx0Jhp1; 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 S1729992AbeKIHgt (ORCPT + 99 others); Fri, 9 Nov 2018 02:36:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:54336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728284AbeKIHgo (ORCPT ); Fri, 9 Nov 2018 02:36:44 -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 34CF421019; Thu, 8 Nov 2018 21:59:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714356; bh=y9Fhwf6zrtSWCTE7Fsp0t0F82Xv/SYVQWyRx8TNmrmc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DUx0Jhp1zBGIZwX9FpORM6ACevYRPHsb/0NiKDkCJhs3rJdlHAjZe0qzpybwFk1Hv ar+Ue/2+SGEa47PjoE3dQat8iz3KVHDBMShBb68xGpglNsePza/r5Rt7oPPRU79gh4 ImZv7oIL9yjoQ/OWifQSxGewOJhoZsaiIkiArEJ0= 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 013/114] sr9800: Check for supported Wake-on-LAN modes Date: Thu, 8 Nov 2018 13:50:28 -0800 Message-Id: <20181108215100.238218675@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 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 a50df0d8fb9a..004c955c1fd1 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