Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp51493imu; Thu, 8 Nov 2018 14:36:35 -0800 (PST) X-Google-Smtp-Source: AJdET5dhhfDZ6fcQXvIjKqPtvW8Ve+HKpWmH9RBSJFiKXxLLghaa30W+XtBWrE/pU09VXZ5et+hC X-Received: by 2002:a62:4718:: with SMTP id u24-v6mr6398678pfa.107.1541716595238; Thu, 08 Nov 2018 14:36:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716595; cv=none; d=google.com; s=arc-20160816; b=blYOJxMT0Rccp2yQacIAodO/7hT3rImSp7zUP1uTf2F+QZuxO9Ab5dZx/PYlWVau79 UHibtJ4IhXhwhIDQwZel5sChk0MCemKiOW+tZKKdau8I0u6gBBtmkFYg6Q3K/6J8vt4j tIOslIcvVjT/GiIkLi9iSOCHviW8VowsTdbu5UdpJjiqmXUDGDEQ0IeU/+00S11uiATd MEncimjLRzMr4T89R9W4b+UJHNvyiWtE5e83TyT8JaKM71dBPfcGd2TsE7Ti+bQFXza+ EnK8AbcomCO/rxwS57GwenhKgW7khQiuBtH7fcsSLXudYPGbHt1XmlxEdVIzCeNvvhIg H8NA== 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=Vp8L1VFU5Ug2YH0BbF6KRo/9Y7TeP8/xU4n2sgun6Bw=; b=h24y7MCk+OwngYG/7B/+83CfZDz4peVnDeDAnB5S1eHp9DrefA/s3F90GwggRO/e4k yGoNSlX/7gm2ECBMpdkmrgdfJ81QY1Hw/HKLCe0AOz09Vsjnm+TL+zWmvSVI+BhOirs2 LQ665su0N1w1jqgHRoF4yvUAgWd8tHYJU0HuQPQnIkl9wlPGOy42p7CCW2xoUVQRk14S KNvWd5yOytVb2mXT2RVedkfsrzHTPxHAiig7wd2naDebDlpRhDWRWhN9ATptDtYdeFlA A3tjdLHNFfSaNisYDWvlYEAfeyzMPXL+GOjRuCLY5FxsYIhVTRylMrqjmsNZjF14cM3g onzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J74wzCAw; 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 62-v6si4790303pgi.418.2018.11.08.14.36.19; Thu, 08 Nov 2018 14:36:35 -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=J74wzCAw; 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 S1729601AbeKIIM1 (ORCPT + 99 others); Fri, 9 Nov 2018 03:12:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:54958 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730085AbeKIHhH (ORCPT ); Fri, 9 Nov 2018 02:37:07 -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 7235121019; Thu, 8 Nov 2018 21:59:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714379; bh=b2upZwmRuSzv0tITW6Tyf9WS/j0dO4ukaksXs2lXwUE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J74wzCAwEW+zGqloDp9NObjMW6SiBQIX4SjH2I080CJDUCMXU3oKa5/D4kzfRwRj6 VVX+/n+woiBKvozMDk05+Z3YNClaVAsf/K55tFJa/rUl1afV0IAuKV0B2vLZK49drG D5PKcN81hE8u+wxRsFldqfNNZ2ScfzypXuEexSdY= 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 011/114] ax88179_178a: Check for supported Wake-on-LAN modes Date: Thu, 8 Nov 2018 13:50:26 -0800 Message-Id: <20181108215059.974920092@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 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