Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp61006imu; Thu, 8 Nov 2018 14:49:26 -0800 (PST) X-Google-Smtp-Source: AJdET5dAUnqVcyxypQcqCRizylPsw68PXD6/2ZiTlaFKluJVocYgefLTLemREFraw/spcRDRWdeL X-Received: by 2002:a62:1196:: with SMTP id 22-v6mr6402468pfr.178.1541717366118; Thu, 08 Nov 2018 14:49:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541717366; cv=none; d=google.com; s=arc-20160816; b=FcT2DiO0TU74FwqQYorX4ROND8Euw2GOMDBEi5bLSw/PGDrAi3c1FU2zWsGlBmSsuw inROCnU+C7o0B45WEHwwg32mHhtTTP3imdjdoBs2zrTJhMJvj+qPzdzCowY6G30nYn3r PKp0RFjVS/xH21p0u9iT3AW0u2dy5m5t+qdsNsYiNxpnDTmK6vW6MldA0+6YDs0fuG7M 2cKMlP0L71CpmcAWBJtPy5v5NYLR/KcPyc8APn2D71SFdr0iEpkOq/mAXQA5Q/RGhXqX FaXMeOxMTH5XzDvwYn6Fdspuq9uWSX6OjTL/afq23AeqpUm3QNp6ezvL+AtaS1de884t VZWQ== 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=lFfI0MYO8U+b9G9mH2WG0K6xSm8AqOIMDmvkffoZWuc=; b=F+Kiicc6kg1EWhu101onDQtWtDkX6DxLOAA+cK6i5QBMUYat6wb/Sve0eHy6FgJeRu XYc7bai92pAlzmQdwNiMwUwXr0S1d71lTnFNt2i6zGNWC/lKLTy7zk/sUenSy6MXk2Dp yQY399biKxKPq4PI/kD2Bmx7abBDdifWoPfegg7i/1o6JyIU/iBWKLeBGQ+ZuujmeqGr GsCatoeBjbTWXkI55/+a5zPkBErDGhFdDhk3ElePGeeSwd8ZuecVURlACgt+7dYSI37x M2xcg8WOcfuQLZAtUB1QKyMtrP7CiU1smngmSST2EsyrXgIzj2vfXXhhUssNFkL4r8P+ onxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IpCVPRdS; 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 v69si5183637pgb.3.2018.11.08.14.49.10; Thu, 08 Nov 2018 14:49:26 -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=IpCVPRdS; 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 S1728005AbeKIHbe (ORCPT + 99 others); Fri, 9 Nov 2018 02:31:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:46186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726875AbeKIHbd (ORCPT ); Fri, 9 Nov 2018 02:31:33 -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 1C59A2089A; 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=OFYbckM2MMoc1XPhohAJH35qJMSw2dMlqlgs0o5aCRw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IpCVPRdSc1/Cvwz0OI2f4bFFIEyuajNoi9KIv1hQaup8+cjMzH62EuXG9iQLJJk66 KTRH5dUh0qEcPehiTKfHfEB1hf6pJ/QGf2foe+AYyii+40lcnbfrFWPjybkYSBpyjn LnK/7Nr6leBZl0BfWTnrV4TuKhGtP0QaaRQZxX5o= 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 028/144] smsc75xx: Check for Wake-on-LAN modes Date: Thu, 8 Nov 2018 13:49:59 -0800 Message-Id: <20181108215056.894284435@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 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 3850c342bc54..31724e40f142 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