Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp277657pxx; Wed, 28 Oct 2020 04:50:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfw6N9Jyi+j6k1WjYCIpgDflq61SNOUB5fBiZMwtTNH1dqzcs/BZTB4s9eRICk36zDTmmX X-Received: by 2002:aa7:db82:: with SMTP id u2mr7380083edt.262.1603885802550; Wed, 28 Oct 2020 04:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603885802; cv=none; d=google.com; s=arc-20160816; b=kZF9gQxyZNt5LMMQyPQ8PHi4dSSsYEBXAuxPWlT9m9iL4pifZVv46nYkTsBtUWnGli 2+5fVivsa6b3s+BNMWC8L+voqXqrgLyF1bdqvoDauTGZ7ot00JHZcR6MDHgPAETGBQmV RqEOhaXS2E+uOtsanT/JseQZrRrAvT1Fi+C/5NLY6SdwQ60h2J64HpMqX8U3H4h9aKR4 99pz2wrgEQN0cm9TTgIb3nRQR1REjuvN/orXC1jyqfIPMrgaplD9AxN6Wo1Lyd0JkjbR KFUC2RLFtYCCY9vb0lnN1pUFkNPQjYWfM5mIefwjIAINsXPHnz2e6UBciaTwxig5iSYt TjNw== 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=AmM+cYGgCQmql6eNqnAEbFNUU3br5OycZ8TNpobuVeM=; b=ztdHaRqiGiAJiS7sB6WOXulvxFNLNfciiCGyF8GxUsDLKX4ixKeFNMM162qsYZL5Br q0XIw/jXKP89CF2IjqidJuOjooMzmSlZotbNJ2tKy7GkPebm2lonkYZsfoFYctEGn6S0 JS0wEspM7S1685i3cHNpjQ9vN9txUBDTvntgoAMQH5CYC4F82y4q2fjBv3DpuD5HWo9X j1fcK6kSRe+F1OvQ/rb6M9zyN8c7G8gPHAM7O2CNO9dMwLJMaJSFYZDg/VKSghcbh9Z8 nDq9N1mPPIfQEbyRq0Updp2V5ILEBeXrcIzmfurqAPa89s9wPTabFbLf9//WmOigdegm HW/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bpGkcXuC; 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 w17si2969573ejk.629.2020.10.28.04.49.40; Wed, 28 Oct 2020 04:50:02 -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=bpGkcXuC; 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 S1794578AbgJ0PMb (ORCPT + 99 others); Tue, 27 Oct 2020 11:12:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:34074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872AbgJ0PAn (ORCPT ); Tue, 27 Oct 2020 11:00:43 -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 B5C922231B; Tue, 27 Oct 2020 15:00:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810843; bh=ebXNB9nP+ifo2uY51WTMYq4sbNc7d8Z2vU0Dfu2fcRU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bpGkcXuCR4T0PzcfMkAfO8+SPGA2/lNq7+m8cn1An2cz2sMQbq4xlYN5nrSHcw+vW /xiY1j9twF9ZavGOvq8EjO/aTgU0zNr49XM2T+lW7dXltXd8QUZ38e/VkbJCzhsbqV hG4Q0BRupsgCDXwIorfZVh1+UdyRFXMDvI08n19g= 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.8 251/633] net: dsa: rtl8366rb: Support all 4096 VLANs Date: Tue, 27 Oct 2020 14:49:54 +0100 Message-Id: <20201027135534.451397872@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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 fd1977590cb4b..c83b332656a4b 100644 --- a/drivers/net/dsa/rtl8366rb.c +++ b/drivers/net/dsa/rtl8366rb.c @@ -1270,7 +1270,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