Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp18523imu; Thu, 8 Nov 2018 14:01:29 -0800 (PST) X-Google-Smtp-Source: AJdET5enaX58uU2OcBJyfB/bsMNR38tEGKOumf0t5YFc3WRZC3A+CQnCjV3cQlQVb/8nXiS8dVrJ X-Received: by 2002:a65:5a05:: with SMTP id y5-v6mr5175390pgs.161.1541714489700; Thu, 08 Nov 2018 14:01:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541714489; cv=none; d=google.com; s=arc-20160816; b=ohyGFktn/w8U+zOeGLV6BZA5xjeotA3Nj6xPx/piE/ss/VYrjMafJi7aDdjRyC8SpP eWfSSwojXnqcuNyt/0ejtO8b3q0U3cbP6plSq2zAZNEw6PHd0P9WiRNIm8A6vhYk4aiT VZZf3geMwvAGMM190gcT23qfAo4IzcpzBtO+ZRePtN5YYGtT39mCwWdcPCuiKktlPXmq KGw5cBxNU0RULN1hg03zuLtFbcQE/ltf86xq5nSdLRDs4otE6V26sWcHsQ4AwUoh+Xug R6yuZ7SY4GPHDG+ZuJNk99fwfGf9guTjqXRg87PQ+KS4zLCSlmx6AXY1g+7/WQD4dnxp wJuA== 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=NaQk5UgHRq87YmR3IevYp1+/YVz9+IDE4ttdqooTEcA=; b=rgZbHjj1+d7GXQ28gmbnPFFOkmIEDWvZm6ZPYtgTxSuH+9jxPRpn8D4aSH0dfa/Myt mOsmFOyJBmrCTrhI82AqnL15xo+/VBb9HLfs6tcQduw2jUfE2iIWOCpL5tEtg8GWR7cd jMc8LwRx/UpOA6JiIEYB/MSkQrj43IYXMfy071hLio8ZeDb4nO/vOS4GrPp9dodg/QDO AaT7J3Nuh3WYL8M5TDMeUUY6MWk6TfDLT4lRScUu3qk559wMiBaf2ed2fAexjhtBQm/N Z5yrYhEHzwTd/gnafVrK0vKntQPK7sSAPnTBZnJjkmW+tsy2fPllg63qOIKQpaPEKIO9 vDrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XRnRnIy4; 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 e13si4610810pgh.251.2018.11.08.14.01.10; Thu, 08 Nov 2018 14:01:29 -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=XRnRnIy4; 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 S1729743AbeKIHgC (ORCPT + 99 others); Fri, 9 Nov 2018 02:36:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:53154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729729AbeKIHgB (ORCPT ); Fri, 9 Nov 2018 02:36:01 -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 4F7D020989; Thu, 8 Nov 2018 21:58:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714313; bh=yXi4AQtyOFnB57K8JLPOS6NKAneqxIQFrDeqkAktRWc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XRnRnIy4zYiT0hMoeT2jBsPZBv/IE2FZpgvotSMqmOIgt0NJX051LosjXdBq5WQE1 G2awHjYrrsbsGzlRazckF4VqkoPRIXxwZhjRHgKfviubmWn/YHsztIgZN8+jHVaxws BvAV5KMFXdD9OfU5faLCf/4/rm1aS3e22zr+6dsk= 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 010/114] asix: Check for supported Wake-on-LAN modes Date: Thu, 8 Nov 2018 13:50:25 -0800 Message-Id: <20181108215059.872482060@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 c4ce446e33d7a0e978256ac6fea4c80e59d9de5f ] 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: 2e55cc7210fe ("[PATCH] USB: usbnet (3/9) module for ASIX Ethernet adapters") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/asix_common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/asix_common.c b/drivers/net/usb/asix_common.c index 7fbd8f044207..2092ef6431f2 100644 --- a/drivers/net/usb/asix_common.c +++ b/drivers/net/usb/asix_common.c @@ -449,6 +449,9 @@ int asix_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_LINK; if (wolinfo->wolopts & WAKE_MAGIC) -- 2.17.1