Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp50868imu; Thu, 8 Nov 2018 14:35:54 -0800 (PST) X-Google-Smtp-Source: AJdET5eg2fe9HIRLSH1tkt4F5P0wn7C2IGrrWxTV298GkxLr3xDBwRGmmfNSYcGyGS1s4SvrFc2U X-Received: by 2002:a62:7e93:: with SMTP id z141-v6mr6591441pfc.241.1541716554009; Thu, 08 Nov 2018 14:35:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716553; cv=none; d=google.com; s=arc-20160816; b=gcGiNgJLjzXp+1w39sAAGA3hgyyxuevEPWPGxHDrbF2yF4vpV23h7psJxXEvScrxFo /j7WquCxiDfOLZ4pXY5fpvKoXnmqU8vCDv2nrhdbTNAIVGKj1YS6XGh/JcJ9C1GHiR8k gycFVxukhZEeisAlYc0u4JIBK7O6ti6t3L+5DglpZThRBjUMC51+d5XrsfOmXxDMRelk AsO3fv4e3YJWcVZg5lQykCa/8kYsh2mkKR4dOETDb0xMY4oO6f/d+D006VD44kHis+wp qbJ7A0eFBb5kHWOLlgWmBm6pDWEpymMX7CwpSRw4ko9HCHzcdw5jS1gjSI6yuTc2biJj +myQ== 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=iUEwNv3Kpuhcoz9N1MguAQlnWLJNbnDN05lvtuXpC3Q=; b=i4cxa6Y+eorEefbWA/JEh/NOOO/hf2lRgkVa97rLsW3rC1HSRis/Np5oEKoRz3JgL3 SzBDSoTQA17qoZ2JAYXkTkc2r8dF3MhS9Mi3OJv8ez8XO3G2OPcy2K+h5QA6cbKwsDj3 LAMYva0VubopIn85qXb8ZLd1XBzjlvl4N0qwEBFTfsUsGpyM8dHoeJ5Lvfcg/h5D7b/J b/jPdnKvv8C2kUXxXILLniPDLZAvCvH1fX9xEbOSe9QOOdgt5GS/8VeJxS/0kXgv9NkB fxq5q87vXRj+3lDYAaqWTK+8Nu/NCiuzngvfpy4FKJR9alBjQBqoSIhkxVmWjCPnrygS sOlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Plz5JiJP; 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 g32si4600498pgg.400.2018.11.08.14.35.38; Thu, 08 Nov 2018 14:35:53 -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=Plz5JiJP; 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 S1730017AbeKIHgy (ORCPT + 99 others); Fri, 9 Nov 2018 02:36:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:54612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729253AbeKIHgx (ORCPT ); Fri, 9 Nov 2018 02:36:53 -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 1343220989; Thu, 8 Nov 2018 21:59:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714365; bh=xUqO6yvjDnLgk2p6SyPN5/fiopGFXwQp2d7EWx+pRZo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Plz5JiJP5AFk7bsChf4dkaOv0DYt/ZP3R6CyHtGA39JH5azpOXR6j+aNg3Mwp+Vq3 uG2S0tZe3oLT+Cc+cw9nrHHf34z6x9zbiWIp7EFl5i5xch50qEWEldoawUNKPICVez 0c77Hen16b3qzaHwElSAKAp1FTx5l+Mb5MGX0KT8= 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 014/114] r8152: Check for supported Wake-on-LAN Modes Date: Thu, 8 Nov 2018 13:50:29 -0800 Message-Id: <20181108215100.447049394@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 f2750df1548bd8a2b060eb609fc43ca82811af4c ] The driver does not check for Wake-on-LAN modes specified by an user, but will conditionally set the device as wake-up enabled or not based on that, which could be a very confusing user experience. Fixes: 21ff2e8976b1 ("r8152: support WOL") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/r8152.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 2bb336cb13ee..2d83689374bb 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -3663,6 +3663,9 @@ static int rtl8152_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) if (!rtl_can_wakeup(tp)) return -EOPNOTSUPP; + if (wol->wolopts & ~WAKE_ANY) + return -EINVAL; + ret = usb_autopm_get_interface(tp->intf); if (ret < 0) goto out_set_wol; -- 2.17.1