Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp220495pxx; Wed, 28 Oct 2020 03:13:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRtAeJlM4K1qrM/+0JHJlXaBGCZo2NLZX24CheWenP0LzW7FG6C2OFe/xsv5I3kPSGGvcc X-Received: by 2002:a17:906:1d53:: with SMTP id o19mr7235561ejh.468.1603879995737; Wed, 28 Oct 2020 03:13:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603879995; cv=none; d=google.com; s=arc-20160816; b=VHKgEnZq3dHw7QPWMZ6lUwjovRSyOPiaqSL24CJlb9z+uDJJthACiDRPEYxpeVai98 ERnxEqFhBMoyjxk5GcJs51C+88H9qMy9rRd7eEm1lRMdFKqYCmmWrryk1yfID+EcJBjC Vx6ZlLU1VvosqZhpytS24Ir37ctMo5no2h2vs2FUHkeB64QubtdBmjUE3STMosC1q+ku hgYrUo9HaniMjpajomIE8//yAQlhrj62kWuQhOsK6FPbiipRf6EOfcaBMkNdggR3+Z3K 8bB1PrCMHVhgF2i4k2TENlA099muM4X8It5BST1AeWXiW3emTKA7e+HwaD2zn0JgzISS ZwJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0Xs2Bp7W3fFU3+hLSy4noC8aX78V971dJCLjvMd7x4I=; b=CP9hvg41ffBYYxCLTxOKnLNcOa7BiF3VwElPcuR4Hc2wIVYC6TC7Q4Kg11W3dsopXT vd71Fa7iv71u/ajwjrwQYlKjCo0pntlIVc3Uw/ndaOROQsJ8S3pGIO65leFcrl2EsVGC lmNgHGCzxKX/2TEf6yP5o1Z+u1JMK+IwvenUgCMTr3ra7xt5FKzYy8xCrVDQymtWNBKz m9FPHlkUZHx13xFxC9nWnmePXkCYF8cR4/Fa2h4p9CQTYBY2iGgOTuYDrBwDQoxKL9lw gX9TuiDD1jDSu9fzxpFYw6KpW6IX1ryZ/UOmgEn9viFyXMhIEcuHL0T8zdYDX8X77ty+ hJ6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AkblUBSP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jr1si3058858ejb.164.2020.10.28.03.12.53; Wed, 28 Oct 2020 03:13:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AkblUBSP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760718AbgJ0OgF (ORCPT + 99 others); Tue, 27 Oct 2020 10:36:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:34184 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760613AbgJ0Of1 (ORCPT ); Tue, 27 Oct 2020 10:35:27 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 E70AB207BB; Tue, 27 Oct 2020 14:35:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809326; bh=LslNL0ooECmB64WwPSF8kT0ObZy7wvntcobCeYzBi0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AkblUBSPflzJPPlJhRDrdGY+PDKgalXVwYxHHYAuwr7X4v2vGNFmxIN2DVHqucfJ6 scHwM76UbidPKGwGrnL6yIL1o0W23/5sx6HstegYOfVh5VU/92tKL9yOX4fi79VOHV Bwod3vauopAmhGr367DWiK3pS76edKb/s1fagEsg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Walleij , Florian Fainelli , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 157/408] net: dsa: rtl8366rb: Support all 4096 VLANs Date: Tue, 27 Oct 2020 14:51:35 +0100 Message-Id: <20201027135502.373921249@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Walleij [ Upstream commit a7920efdd86d8a0d74402dbc80ead03b023294ba ] There is an off-by-one error in rtl8366rb_is_vlan_valid() making VLANs 0..4094 valid while it should be 1..4095. Fix it. Fixes: d8652956cf37 ("net: dsa: realtek-smi: Add Realtek SMI driver") Signed-off-by: Linus Walleij Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/dsa/rtl8366rb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/rtl8366rb.c b/drivers/net/dsa/rtl8366rb.c index f5cc8b0a7c74c..7f731bf369980 100644 --- a/drivers/net/dsa/rtl8366rb.c +++ b/drivers/net/dsa/rtl8366rb.c @@ -1269,7 +1269,7 @@ static bool rtl8366rb_is_vlan_valid(struct realtek_smi *smi, unsigned int vlan) if (smi->vlan4k_enabled) max = RTL8366RB_NUM_VIDS - 1; - if (vlan == 0 || vlan >= max) + if (vlan == 0 || vlan > max) return false; return true; -- 2.25.1