Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2455778imd; Fri, 2 Nov 2018 11:42:22 -0700 (PDT) X-Google-Smtp-Source: AJdET5fY9GGcE55Tr5fqrZOfEseM6wYDz2ZrNNCMoEtyETzrFt4osmlsCrdUU70ULPYKFxtKHUJc X-Received: by 2002:a17:902:e005:: with SMTP id ca5-v6mr12483796plb.195.1541184141937; Fri, 02 Nov 2018 11:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184141; cv=none; d=google.com; s=arc-20160816; b=l+0DezW6EsVj9oRFxNw/3oK9QKVJfeBd/jsZOb443VgAe2GTpoH45glgqBgAKL3PM9 +qNBskZ2ymBmYEznBYoWyFljNBznzFYWe5mvOfpYc9CVGQPR0FSx7Gvk3/hjSGngRbGf xzZCaF0nmjFsGDF2uJ4E/tjkWX3xxI21lVSssGH4YzES7/Uit2sYhsTIA8jToOZ1w5KM PybdIWVda5fsQjoxUJFNTPu+l4A+LXZHL92+NHNnDq8xO4DGvl/ZYB11DaB3RbRqQnK7 g0/8xtyyW2b8ynSm0BnuMHzeiAaoVMkC+LpY3bDfUOIcA5udKMsorFqHEC/WZkXNH+gH QMWg== 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=Ek7YoiPhGMFkT6L3HiAJrpjVD9DKN/0VyU9Fz+oT1js=; b=Kx3E1VgMeajYdOoSW0iGDdw1ahQGYPdTCP2iMjDT76pvyq9zm8Yz0paEhLN7KCuti3 JnKf17dU2cFzk6p0B65lxFJfDBc8ZtHuVHVmxWuf258l6wJ2kJLTUZIVAd9VeY2ROiaA I5GvKkL0LOGBIWtlFnEsbe5BlCxqSdVpY8c2r1LJzgm2al4P6zuv1RJeXCtjthq/X6GO OmD30V7bC+iREE6h7XW8nNS5KLgvQw8wTWFvHYtiE+4H7rg6qBpT4R1FnBiyxZIckq0K cx3xHGwmxhCmzet8ilNEvKprfBZzniC5tVcdRbq95X5XNYvV/nUSXeLoVtw9WQNsk1R7 B6zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="U/aWOMwF"; 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 f7-v6si34089358pgn.108.2018.11.02.11.42.07; Fri, 02 Nov 2018 11:42:21 -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="U/aWOMwF"; 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 S1729270AbeKCDsI (ORCPT + 99 others); Fri, 2 Nov 2018 23:48:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:42400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728250AbeKCDsH (ORCPT ); Fri, 2 Nov 2018 23:48:07 -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 84E382082E; Fri, 2 Nov 2018 18:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541183996; bh=PfsXxQkJnDZSvd1+veOOE1HuZXeYhDc/big8UE36+es=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U/aWOMwFBWVqEQlRmRg2zxjODohKxlDBZQxm3e3XF6t4VYKqqNabtbUY0q+Bo+bIm vbln0NJoClMcMceHGLHOp/0Z89vpqavH/VEd5ckRYcF1M4fIiX46mGCJbTjFH+SrmO 4+DJGpVBRvKg2Vgn5e8M3C71d1rf/QoMHjKpC42M= 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 046/150] r8152: Check for supported Wake-on-LAN Modes Date: Fri, 2 Nov 2018 19:33:28 +0100 Message-Id: <20181102182906.656692902@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 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 1b07bb5e110d..9a55d75f7f10 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -4503,6 +4503,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