Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp60284imu; Thu, 8 Nov 2018 14:48:26 -0800 (PST) X-Google-Smtp-Source: AJdET5cOGJaYDhafRDRyoCnNz0YPyvCh/2jYxZst9OI+E/BbmkS09rT2V1XXNpXxzxxjKDGMYuAp X-Received: by 2002:a17:902:b701:: with SMTP id d1-v6mr6145190pls.29.1541717306581; Thu, 08 Nov 2018 14:48:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541717306; cv=none; d=google.com; s=arc-20160816; b=HgZixXzo/D2lpA66VcoAUOT2nfU96tCRQm57biv8WLegbKW9PrxxrMsutykIkcEHA6 B/r+muQMKCttd4g2rmSRncd4HxJue0XrRn0k1TbANWAzvpt0KaeTLynqfmDrOrGee50f D8UYeLG3Iki3jgj/LTaTqIJYheq6CGwq1JMP7aeyOk4QwksNHlcW5nL56tIe9jS9vGwb NvW7MaxgLKrP5GUZmZPaSGONqKZYNkym+kDiAiz/24/adoJ7ZdWHnavBh9J9bcz8p+HZ llEcvagwmlKropUMmXZUEMQldIDNo0naP/hSKJdHDoB/WiyncFOnBjbLexUI3R2GaRt6 5TFw== 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=wMG56nfROKZk6Dveru0slDyRNvChKVXY5+GyGDluezQ=; b=XgqU7uDUSK6V+XREN9UoOxUrHM5OXAnQBghcC4TePZAEKoxzgP+vgF1ESBNQUi8WmT 3A/hWkcsbiPL5koDKFBl4zf9aXvmhvDxBxqqJLTKw7R3VGctYU7b6uZ+AB5F4IrSsWnF 7WNXjY0sbtcyKFFq+tRDpoMQD5IkwXJDEpQWI+AUng1cgs0xgNv0Yl2RXTsvGMVD5LmC 5nIaQCpTrITSVkMl1745y5t2O49Tobn8nr1h9oA83o4nUlfyjLcaJjilEH6QMMmswvt7 eIkNXYeaVNeyZJ3tIT4S1nV7fFvwIrSRdMdUIkMyvFTJqOs+GhNGaHeM9IBlVY8Zaydz iQOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xNkBR3K6; 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 e6si4654532pgl.471.2018.11.08.14.48.09; Thu, 08 Nov 2018 14:48: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=xNkBR3K6; 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 S1727876AbeKIHbX (ORCPT + 99 others); Fri, 9 Nov 2018 02:31:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:45982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727765AbeKIHbW (ORCPT ); Fri, 9 Nov 2018 02:31:22 -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 DE27320883; Thu, 8 Nov 2018 21:53:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714036; bh=9lrd7kUzLGQko619iMxS7MJh3CVtpoPELrM1gSymXr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xNkBR3K6RSUK33EPPInuLVlLo9DSgeHjShgVdLvZ+zmigD0ZT/Jun8L/vnd1FxtBE 6wtukZeyMBshVKXnZvOLLKdwUF0Eixx4+qLCUZjn4o1vbERJlSIurGvPhCstm7y0SR sGnnu1id7KzwQe3gjSziDs4dI/wog8ZlZENq2KlE= 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 3.18 026/144] ax88179_178a: Check for supported Wake-on-LAN modes Date: Thu, 8 Nov 2018 13:49:57 -0800 Message-Id: <20181108215056.750925449@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215054.826084593@linuxfoundation.org> References: <20181108215054.826084593@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 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 5ba6b4aa9a410c5e2c6417df52b5e2118ea9b467 ] 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: e2ca90c276e1 ("ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to gigabit ethernet adapter driver") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/ax88179_178a.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index e6338c16081a..e3f2e6098db4 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c @@ -566,6 +566,9 @@ ax88179_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 |= AX_MONITOR_MODE_RWLC; if (wolinfo->wolopts & WAKE_MAGIC) -- 2.17.1