Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp52589imu; Thu, 8 Nov 2018 14:38:08 -0800 (PST) X-Google-Smtp-Source: AJdET5e82ns+fraHsh0A0EZlKgZTflfdXk/9i1me42jT234TRFpvw8xk1D5hUKlG9cduiVLSg4e+ X-Received: by 2002:a62:ea10:: with SMTP id t16-v6mr6740626pfh.228.1541716688793; Thu, 08 Nov 2018 14:38:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716688; cv=none; d=google.com; s=arc-20160816; b=WgWeQhtERPtljrZYywA9lfKOPJsh1El2EqqjyRuo4LELR42sjeGWa7CJlCERoXE+20 WB52IoPYKy5lYRAgx0HxpJg8SRUe7zBTeusVCQS6mEieStL7AoxeELbjI7SARZuFXPWn SwOm5LdaQPcMTDLV/9056L3FHXqpD5ZmNS/+7+Ox2KH8dnlXQ3ObML6zhkBR6wFGzx0W o8THfBmZOMYeP0MUm7HTy08f+yNaonoVLWAfI9qHJFTptH6gJLwk9JE8RtTWILDiFfOK COMQfD0UrvWIGMYYDnHYWF80f53eVAGD9FRxMISLboyknlK0JR3GEbg0A7YSAkazmpxO bZ5w== 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=Hg3R5snDhgEextTYqIE0q9gBxuJIZC+Hxl4UaiQWo+I=; b=TJMtBAYDM/FK999jcYJw1iWiYIiNLBl5paxk1LUptWIzs3hp4m8pj/Mj3BWYNmEnmq IKwV/ClfharbFRIJvKSZOMRLuOmFN/keS4eUT+uCkSViT462aUMVl0ZlETq5t2U2Y6Va 5Pe5umzxbY6lamD2Ih05OuwM5SO6X1ZvShspekXqSoY8j3cy7+piKRApOMgxy/JEIkZy G82stavjXncWZW4XqwyPzXATUiwXm/2JFQPX53QORCbxzuEjagF2wA5uKtD8XGBLHRoN r7hH5tFghRX3luAalsIHkKcCl7nvOdpX2DH0YTOv3axYlVKNQ+0wbNNE0yidZGh30VxV SCJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NVD9jd4A; 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 y40-v6si5610982pla.391.2018.11.08.14.37.53; Thu, 08 Nov 2018 14:38:08 -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=NVD9jd4A; 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 S1729857AbeKIHgY (ORCPT + 99 others); Fri, 9 Nov 2018 02:36:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:53764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728496AbeKIHgW (ORCPT ); Fri, 9 Nov 2018 02:36:22 -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 6F8932146D; Thu, 8 Nov 2018 21:58:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714334; bh=39/T3iRdmRUKhFcaZrKfSQmCdXeQ7wG2GOroB8g6qAM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NVD9jd4ATwKnJU/lcnu1Spt+Ekl/nbnChzvFSlWVBqFePJA06IDb7zA35WtIcRNBY wO8yMNkWbB8dutRYfSZO38FQe7GJVzagcVWu9+VKfySqgKRuQgnu/QE9tuwZVExVog fCriHZXa5MXjo+iaFkm15wSVSNzzbPqL//CMOf2s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , Woojung Huh , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 012/114] lan78xx: Check for supported Wake-on-LAN modes Date: Thu, 8 Nov 2018 13:50:27 -0800 Message-Id: <20181108215100.081022026@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 eb9ad088f96653a26b340f7c447c44cf023d5cdc ] The driver supports a fair amount of Wake-on-LAN modes, but is not checking that the user specified one that is supported. Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver") Signed-off-by: Florian Fainelli Reviewed-by: Woojung Huh Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/lan78xx.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 1aede726052c..45a6a7cae4bf 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -1051,19 +1051,10 @@ static int lan78xx_set_wol(struct net_device *netdev, if (ret < 0) return ret; - pdata->wol = 0; - if (wol->wolopts & WAKE_UCAST) - pdata->wol |= WAKE_UCAST; - if (wol->wolopts & WAKE_MCAST) - pdata->wol |= WAKE_MCAST; - if (wol->wolopts & WAKE_BCAST) - pdata->wol |= WAKE_BCAST; - if (wol->wolopts & WAKE_MAGIC) - pdata->wol |= WAKE_MAGIC; - if (wol->wolopts & WAKE_PHY) - pdata->wol |= WAKE_PHY; - if (wol->wolopts & WAKE_ARP) - pdata->wol |= WAKE_ARP; + if (wol->wolopts & ~WAKE_ALL) + return -EINVAL; + + pdata->wol = wol->wolopts; device_set_wakeup_enable(&dev->udev->dev, (bool)wol->wolopts); -- 2.17.1