Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2454365imd; Fri, 2 Nov 2018 11:40:56 -0700 (PDT) X-Google-Smtp-Source: AJdET5ecjYViVOD8nsT9Xgr25YNFmg2LbCVfcm6TXjRoQjmWPBC9AJ9xhAeFoPUAXD0VjjOECwKQ X-Received: by 2002:a17:902:7408:: with SMTP id g8-v6mr12410985pll.168.1541184056684; Fri, 02 Nov 2018 11:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184056; cv=none; d=google.com; s=arc-20160816; b=znYUYTaAKjsn3ST8ZqMrZV7kgE1J3dv8urHs9c4DVpdxOe/jqpqZ+Xoe9Fdb/qHC7z k6cFtzXCStEMJuhBqud72QDuWF0P5GSLLZow/4cg5PvHalbjm/3p3MwST5Y5P6ogwlgT 60G+YxkZcnctFPhP6PJqcpjvJPYo5U17OIUQ0R7VZbo7HEguQ9J2+vjV6BOelo9oQlQA 8Dmllyn/i9AApgb5l9Gd+KfhzqvBR8foAbYpxnDz4By5Y5IPdRbigjPBP53cIw7a3lk+ pJOmEah/ZmbylTnCSCKEYz6KPLv97tsWbsI1KoL83F9p84/55KQ3P5CAJin6jOypuZdt uy3g== 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=u7gJ5d2m9KN/jpAeLtJlXFVgW80qswswblCUO5PITJY=; b=cAk+SKnlYP2Ba6fhMOBn1V7ojeLXdN9jXEZv/Wg8gs86nIAzKSYLAT3yxXQLC67AB7 CGvbeksrU+/7BgbjBXR6gIH3ogwx94bQDyKP4d8yuHyApjS61YcIovxZMEbXXvec8ZsA Jm/T0LFdiSyB3zOIMNFgR3lJSbGzD56juLCOPFrPH3zRrciFCNustaQHtZSvfc3E0Bch LpTV0fVMQKxdw3rYro86vRp7wtiCMW5MOpUCOV0T430U5l0un4XR/zOzBJEyQ57DSixi I2msmdE9580JYtjfwwCcdHnuoYzwnkWrSUjTePcauUT/GuC4GLumMP3J7ySN+e2gfcff s9Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nlNfb6Ky; 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 w20-v6si32654050plp.260.2018.11.02.11.40.42; Fri, 02 Nov 2018 11:40:56 -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=nlNfb6Ky; 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 S1729236AbeKCDsA (ORCPT + 99 others); Fri, 2 Nov 2018 23:48:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:42194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728250AbeKCDr6 (ORCPT ); Fri, 2 Nov 2018 23:47:58 -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 E793E2082E; Fri, 2 Nov 2018 18:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541183987; bh=UfFEpMc33DpXQUu5qROBUN6iO7ngeuVdV7RiLNBet44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nlNfb6Kyc+clTbVi5GhAQHIrdDZ4n/ibGnNDymO2P4lkno3iWxdZJ+XUzDMiKhOQS Ym1TqeYWNplusXrdqSwfzDcDi+Qnc3XuS8N56QNO2H+MU974wrJ4fBeljUCeywLCzN yg8YygDmPJetcfB9G0uz3bvZPJF9p5D8oXyOpz7U= 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 043/150] ax88179_178a: Check for supported Wake-on-LAN modes Date: Fri, 2 Nov 2018 19:33:25 +0100 Message-Id: <20181102182906.401051080@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 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 9e8ad372f419..2207f7a7d1ff 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