Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp12585imu; Thu, 8 Nov 2018 13:55:11 -0800 (PST) X-Google-Smtp-Source: AJdET5fEZuqTw3uVj+NpBfaYbtOZz/JJWiWfxpN4e0opNWayW4JZ2+OVX0vQf0k8dXCLbdW6IICk X-Received: by 2002:a63:ea07:: with SMTP id c7-v6mr4975361pgi.361.1541714111234; Thu, 08 Nov 2018 13:55:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541714111; cv=none; d=google.com; s=arc-20160816; b=riUV8eTaxc3BYP514vc1ao3vwZJdba4jfxN4wDP4YctBjPqN5c9UmZqnuNa+8AA7U4 +axkrd8gxdUtARKwSQRr7PFZsjqnl+6MDvLdZeq1YLEKWTXJxzUI8koGxuo6j7o3qexL PAeud9kbjersrr8pvNAxCRMlddUGjL+MMQ2NvzMyPn96ctGy8poVsumkpgiZFr6R3h9t Sdt4UpU9ZuW5wEHU6KNDDcOFBHCERDqeGZw+c1hiUUzyURtFeytPXf9V8bLyb7tz767J IdX342fmhuZhb/E4KCRJ99Ed/0yNh9kHK9j2AOqblWNzIAxU3Z7uVLL8WNp8V/tsWO7k TD9Q== 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=ntNz8tT+32+EHH1EOxinBQdz+pdjdCf57hReIO61Veg=; b=sJ5sgpnrbcarT8yhG3By+BiH8Gg8of6JGJN3ACM4nptXZUR23FTgQnn3lMgM1coghm 1oXZJWm4NZA7RTLLXT3xkNYRyBT81L/gNZcIm/Xkz0sl1kv6GywbfW28D116FI1T+SKQ 48bIGxcfy4RrsDSwfbNTIlax1mAnj30bmcyUyoneWO/vKjnWamBFcLyiZpjpmWcpt1fU zwRNYQymCl/WIYeTX8vBh5dSWGXx/ZoBj4OQNF0cXjt0MR+zJpN4/O3xrdvT9TDWIqbG hzTePLkaIYMHVk37QDdVDBH4E21lXaPQ6MZiFqh+TDPH2xPVOUNO3/N0DTpPgExIc2dq pZOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=z3IXMdhX; 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 z14si4602282pgj.73.2018.11.08.13.54.55; Thu, 08 Nov 2018 13:55:11 -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=z3IXMdhX; 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 S1728026AbeKIHbe (ORCPT + 99 others); Fri, 9 Nov 2018 02:31:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:46208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728003AbeKIHbe (ORCPT ); Fri, 9 Nov 2018 02:31:34 -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 ACE092081C; Thu, 8 Nov 2018 21:54:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714047; bh=W1bHLkoh7OqiUhrSz/F/rRzeHsRhcHpJ56MMQnL9ggY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z3IXMdhX8x7HAk64gGovz5AEtC41QKrA9hPI2sAYGkCI7DwnOHqhi9Kt2d/t/hr69 ievqASlTZYHOQeqiLO9FiWvbylpXExVXuS3qZuC3dj1c8zOmLv6GkbQ/lnFXG5sZSr gheVUbDGecHRsRXM6Q9mDXiTQCwgoYRKtRrE/njA= 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 3.18 029/144] smsc95xx: Check for Wake-on-LAN modes Date: Thu, 8 Nov 2018 13:50:00 -0800 Message-Id: <20181108215056.952266805@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215054.826084593@linuxfoundation.org> References: <20181108215054.826084593@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 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit c530c471ba37bdd9fe1c7185b01455c00ae606fb ] 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: e0e474a83c18 ("smsc95xx: add wol magic packet support") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/smsc95xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index d07bf4cb893f..cf71dc04b5bb 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -727,6 +727,9 @@ static int smsc95xx_ethtool_set_wol(struct net_device *net, struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); int ret; + if (wolinfo->wolopts & ~SUPPORTED_WAKE) + return -EINVAL; + pdata->wolopts = wolinfo->wolopts & SUPPORTED_WAKE; ret = device_set_wakeup_enable(&dev->udev->dev, pdata->wolopts); -- 2.17.1