Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp17674imu; Thu, 8 Nov 2018 14:00:52 -0800 (PST) X-Google-Smtp-Source: AJdET5d+L/3sj0ar8hq8A/2f64H+fRz940wocGTKrtAmjMl1uVLjRaqGnMWX1NmKLuB3Na44Ehba X-Received: by 2002:a62:4641:: with SMTP id t62-v6mr6341601pfa.200.1541714452310; Thu, 08 Nov 2018 14:00:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541714452; cv=none; d=google.com; s=arc-20160816; b=B5QWujDxgA6VSXCyQKWjmQhG9NfYUcTiSeug197BQ02Opj0zG0MqpLwu3tH6k9yE5/ +F4O0pdP2c7i3mdvoUSmxho0oUX721WmXuUrb8plshRxBVfnfJzhg1jDXbG25b66g+VE sE9k1EwAu/j0rSo6tfFw6PaMuYU4xjtfeWGmeEI590IjuqIZxeYRIodEY1LY1Uc0K1Cb THZcDtSnIobKNo54d4dJ9mfLLiU/90w7r+AwdejQoFOaZ/0wQAedG1g+HfmBRQq64WjS thQcAVOoeLhj2HRrlnF46Ry+gAx6vezNWBsskvu8eFJ/5GQZQnCCA4kpHfn+8uYn3oc9 J4/A== 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=W7U6BYVJkWMDGXxKasr8NcPy75R01AJ5BpGRmvzU8xI=; b=WYc4wz7p2rSyPYyBnf7tZ/s/V8X7UZXc4/x+unEDUZl2Y2RHUi8jZvkbxDOjUpDhFM bX9YbTjwXfFPzN0E6P15BOdxW4R6ti+BuwfBjdlNt+F/we1crAJQPYxe4e9GRMrjCX+H Es0xN60AfKjA/tWDAl3dSFMBpDjjLKTgIEYNsW6HxVT/Zb2ZVNQxy7izlXkvTQe8xq3C 3H37sbpT2J+MQGGRH7zvE1WpGqLL68dDEBx+OCNJnoZiweohzjoJoLhwf3pkVJLNpP5k BEvtOGIGeJjwFT37zCPi1c6kd0YMQ0Uc4lyn5cEWUvbhLwsHC+TdSnd46UEP1vibUYXX DPEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l8UtW9TG; 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 w185si4947835pgd.518.2018.11.08.14.00.36; Thu, 08 Nov 2018 14:00:52 -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=l8UtW9TG; 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 S1730042AbeKIHg7 (ORCPT + 99 others); Fri, 9 Nov 2018 02:36:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:54696 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728345AbeKIHg7 (ORCPT ); Fri, 9 Nov 2018 02:36:59 -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 B068D208E3; Thu, 8 Nov 2018 21:59:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714370; bh=oxptC3DU+aXULO+nkHfn8CSX64/lxmzS4RAePucuhE4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l8UtW9TGtTNO6VWejRM+U6pb5wZcJcbHSyo85sL+Eh4In9DvI/Et+ZZtqzeZZAds0 U74QktToFd3Ixgsd2Kac8fQ+/bS4OyQgBQsYMDOPzVNT1w5mzM+8m+pzxbEHBobxKH AiilPEuKdZlXDpDt7ORCsuEdyGxnHRJbmhWd6EJA= 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 015/114] smsc75xx: Check for Wake-on-LAN modes Date: Thu, 8 Nov 2018 13:50:30 -0800 Message-Id: <20181108215100.573622059@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 9c734b2769a73eea2e9e9767c0e0bf839ff23679 ] 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: 6c636503260d ("smsc75xx: add wol magic packet support") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/smsc75xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index 8dbe086e0a96..234febc6e1d9 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c @@ -728,6 +728,9 @@ static int smsc75xx_ethtool_set_wol(struct net_device *net, struct smsc75xx_priv *pdata = (struct smsc75xx_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