Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3002467imu; Sun, 9 Dec 2018 14:49:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/XmHTZnPAbIYspcSZ6nG1EhXxbgpwFI7YIR3givCLRVCQ3gi8YNjufHZKdGlfM7uPIKYGd7 X-Received: by 2002:a62:ed0f:: with SMTP id u15mr9929141pfh.188.1544395781832; Sun, 09 Dec 2018 14:49:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544395781; cv=none; d=google.com; s=arc-20160816; b=K7gmhI6j3F1p6rh7cLK6qfPx+eaTYrBzWL4dgRN6oCG/30m9QCW+LEaMVIX/ckVCqa 1BJqxqKLvGJQV34UV+lex/Ch2uaVhhG9Rjw2vFHbqRf81nyijS4U8M6ak23SYgeV2DQb pxyHTjyFOywUTOwORpuPPvhUyGrKDzRvgFvret6S30lNB6sIF3TdGQRib+XbZL+Lk0CJ WaxO42TJFPRwOrpr9IRIqhtBWs/fDYaabGG4c6InihpMD64OSszQLQ9rdQeZNv1kli6w xk2eQYhvQCOzAixiTFv6vhhcEe5x3lVnTClQG7sdLAcrIZ17iZ30ynkU2JbkX7WI2gIq YYQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=8z5D241SAIKyRJYCZk4YZJJsOI4p6wYN6we7DqpXmhU=; b=ajhnXsyMIi1Z1b86HMf7JU3rBHkSOURP0qaS8hq08waTXi4aRfPn1All+HwyBj/qt9 RbmPTv9e7sF8JXpm83vdr/gbrKXYkPhcmoDXxDuwXuNRH6b5uqp77K1R+zkdDO46qEac 7KGjQWSfLOkPnLUrLaMF1ryvvOs4TKcf/XspAhzh3NN5EW3jyuUwwuuYLsWNG5XcA4Iq mTydaAl5VFCggF9jC5tr1acdJI/pBLDylS/o9oefDP3FKyc600ifsIbgitK01A6Iztje vHJn5aP5YHuq53KA9193vVFO7BBzGySze/6lOEfvB8JX57mh9sRLp1q42cCp8/3BWFYC 3HSw== ARC-Authentication-Results: i=1; mx.google.com; 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 r2si7932262pgo.483.2018.12.09.14.49.18; Sun, 09 Dec 2018 14:49:41 -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; 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 S1727298AbeLIWCH (ORCPT + 99 others); Sun, 9 Dec 2018 17:02:07 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35806 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726645AbeLIVzb (ORCPT ); Sun, 9 Dec 2018 16:55:31 -0500 Received: from pub.yeoldevic.com ([81.174.156.145] helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gW72u-0002ik-7T; Sun, 09 Dec 2018 21:55:28 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gW72j-0003cM-NA; Sun, 09 Dec 2018 21:55:17 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "David S. Miller" , "Florian Fainelli" Date: Sun, 09 Dec 2018 21:50:33 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 274/328] sr9800: Check for supported Wake-on-LAN modes In-Reply-To: X-SA-Exim-Connect-IP: 81.174.156.145 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.62-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Florian Fainelli commit c5cb93e994ffb43b7b3b1ff10b9f928f54574a36 upstream. The driver currently silently accepts unsupported Wake-on-LAN modes (other than WAKE_PHY or WAKE_MAGIC) without reporting that to the user, which is confusing. Fixes: 19a38d8e0aa3 ("USB2NET : SR9800 : One chip USB2.0 USB2NET SR9800 Device Driver Support") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Ben Hutchings --- drivers/net/usb/sr9800.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/usb/sr9800.c +++ b/drivers/net/usb/sr9800.c @@ -421,6 +421,9 @@ sr_set_wol(struct net_device *net, struc struct usbnet *dev = netdev_priv(net); u8 opt = 0; + if (wolinfo->wolopts & ~(WAKE_PHY | WAKE_MAGIC)) + return -EINVAL; + if (wolinfo->wolopts & WAKE_PHY) opt |= SR_MONITOR_LINK; if (wolinfo->wolopts & WAKE_MAGIC)