Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4218194pxt; Wed, 11 Aug 2021 00:13:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzV1/m8Jrmp0OA9mG94Zgkbmzv9/qm9xxP0hN4GKNOY9V3I9USkQTZg3rGezJBF+6Fe+Z18 X-Received: by 2002:a5e:c311:: with SMTP id a17mr48748iok.22.1628666029073; Wed, 11 Aug 2021 00:13:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628666029; cv=none; d=google.com; s=arc-20160816; b=hDT2CvwI4OmJ6q6SznpWolmfW8G9v6Xie9k1okJwXOEhItDMOh2eMBcPGKpzooByXE h3Z8dVg8LL4q3sRn+f1ujyyvA7H+461NcPYtr2vdf817KlAXt+qjQ4KYxiNgiZZF+E+o UUjfGJTrsTAm6cepLy6LwI/v7trgqdhYjDtnotpZks2ht8haB8gA7lLSRC8EkpVpqd/2 DlLNQXSP47XEvmPHbIXkiH9LQ9aG57R+7WbyN7ANzE7F4nHUiCuXF4+NM65X5m2Sxi/j U9Jtx0QHRqGJ5jOzFtL3QYlPLz2Ml2fAc5tKyUQPyhLWn128FBroM8debRbC6VtUzNcP BAww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=4gQDnXtIowb+iwzPA4P5hdpgB4LuMUgDcLuIvtXg2ns=; b=Wn/Om4XzPB7HK7pwb7hoosQ/IanM/krXw4OF25IiXWeZ6dQBInzywKgjOb3AxfhuY4 C8NUGNc8O+nI5+v5StKFlZwQOETge7pnE+rnzBkD75In4AbikRKztKdMvayABnpzgiTa eaMidbwkvA398S0qiSqey2TvAGVuWNpfR7+ABfNIOxafCGk0UtJfI+aIATUhdHyXqdOj JSLkfPFtu7V3YRr25/IKbxyztyIWStF4OddIR8/OWQSEH138jtYPi6zFjzWZVt6o2Xc7 EYspH//4c6JAGgoc+pTFDR4f2X0qe0v0613cc2k2OKFKt333HFhxSUZUUIETWzdNgYmn lh7w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t189si13972021iof.92.2021.08.11.00.13.37; Wed, 11 Aug 2021 00:13:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235420AbhHKHLc (ORCPT + 99 others); Wed, 11 Aug 2021 03:11:32 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:38240 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235119AbhHKHLa (ORCPT ); Wed, 11 Aug 2021 03:11:30 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 39AF21C0B76; Wed, 11 Aug 2021 09:11:06 +0200 (CEST) Date: Wed, 11 Aug 2021 09:11:05 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Harshvardhan Jha , "David S. Miller" , Sasha Levin Subject: Re: [PATCH 5.10 130/135] net: qede: Fix end of loop tests for list_for_each_entry Message-ID: <20210811071105.GA10829@duo.ucw.cz> References: <20210810172955.660225700@linuxfoundation.org> <20210810173000.220428504@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline In-Reply-To: <20210810173000.220428504@linuxfoundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > [ Upstream commit 795e3d2ea68e489ee7039ac29e98bfea0e34a96c ] >=20 > The list_for_each_entry() iterator, "vlan" in this code, can never be > NULL so the warning will never be printed. Could someone double-check this? Because changelog is not accurate; condition is using logical or, so warning can be printed. I don't really see a bug with the old code. New code is quite confusing, and if the vlan with required vic is the "head" one, it will do the wrong thing, no? Best regards, Pavel > +++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c > @@ -842,7 +842,7 @@ int qede_vlan_rx_kill_vid(struct net_device *dev, __b= e16 proto, u16 vid) > if (vlan->vid =3D=3D vid) > break; > =20 > - if (!vlan || (vlan->vid !=3D vid)) { > + if (list_entry_is_head(vlan, &edev->vlan_list, list)) { > DP_VERBOSE(edev, (NETIF_MSG_IFUP | NETIF_MSG_IFDOWN), > "Vlan isn't configured\n"); > goto out; --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --UlVJffcvxoiEqYs2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCYRN4CQAKCRAw5/Bqldv6 8oWdAJ40iXM9RWRnOMRdz8yoM9pxCKWjkwCggWdRY9om8nbfaB+K0uxa/hDiFSE= =AuQV -----END PGP SIGNATURE----- --UlVJffcvxoiEqYs2--