Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp90526pxw; Fri, 8 Apr 2022 01:51:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzb3rh4I6c3DKF7cqncs43Wiy3U/UI7sMrNfnkkiCX5Z2hoX7sMJjG9wQ+6pyr6Gg/rZLEf X-Received: by 2002:a17:907:1b20:b0:6da:649b:d99e with SMTP id mp32-20020a1709071b2000b006da649bd99emr17442258ejc.712.1649407909079; Fri, 08 Apr 2022 01:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649407909; cv=none; d=google.com; s=arc-20160816; b=c4U06f28msgZTHMBCRYInhkPA0pVOv5DLbunIFH281xnysksr3zh6QUhZXNmitklSD sMkEtnDyBEdive+RDqqhsoygpMSOTd+4rs5lal69Xb7etH8QdRDY9SIJcp3V7D6w7P0v Hyd6Fkludk0MmoPCJhtgG8hFZz1ZsHLmiqJKZ4NB3gjM1JRzJiYejIHdYsGAGa+IYxDZ KsFh1mhqxPkgMoNH3Ezqhquth280u7a/ZmdrCyuqC89YlU/YljEK9BXTuRqZzxJ4w5sq 2OU9O7+ODdydFAL8gnWyLy7Pn+xtUYL7luZTuagjBuoO8WORoVCuLklPkpE5RXiHzwk/ ZChg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=zJDP5NpxYJTewMozvxY0bGRQ65znscQXqKLp2sswEXY=; b=ST93ABtBBeGq+x4hJCpwPbXYyePubJPEvT8kUG6lNZHlR4GYuoZtGo0No26P9+NVwn 0ClrdQd3UUobv+wrte3EeR+p7+GexO7NX9L1kxclHvBqm9605m/UQ1wLrIl34oaTb5+E cO/xg9dvl/tYkWccWkE2Tjyc49/+ZxqNi6jyOoPQ32cfjm7jZpvLAS3FMcUUb5y9gitH pTLanomRQ0DUmL7Cen8TY1HXVz86fUjwcY+oxvaLA+P9dlW4FHPntqKDok2NT/1uusLo Ajg+4fEfLruWKNTGjvOBZTjIhZ+IKAJCC69oc7LUS0wfTuYhR9zrh3WTxWSZFlRzsdBS 0img== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d24-20020aa7ce18000000b004198b4add36si334337edv.604.2022.04.08.01.51.25; Fri, 08 Apr 2022 01:51:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231834AbiDHIek (ORCPT + 99 others); Fri, 8 Apr 2022 04:34:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231940AbiDHIei (ORCPT ); Fri, 8 Apr 2022 04:34:38 -0400 Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55D542FF51B; Fri, 8 Apr 2022 01:32:27 -0700 (PDT) Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1nck2O-000SI1-W0; Fri, 08 Apr 2022 18:32:14 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 08 Apr 2022 16:32:13 +0800 Date: Fri, 8 Apr 2022 16:32:13 +0800 From: Herbert Xu To: Jakob Koschel Cc: "David S. Miller" , Greg Kroah-Hartman , Bjorn Helgaas , Amey Narkhede , Christophe JAILLET , Lee Jones , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Rapoport , Brian Johannesmeyer , Cristiano Giuffrida , "Bos, H.J." Subject: Re: [PATCH] crypto: cavium/nitrox - remove check of list iterator against head past the loop body Message-ID: References: <20220331215910.884374-1-jakobkoschel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220331215910.884374-1-jakobkoschel@gmail.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Mar 31, 2022 at 11:59:10PM +0200, Jakob Koschel wrote: > When list_for_each_entry() completes the iteration over the whole list > without breaking the loop, the iterator value will be a bogus pointer > computed based on the head element. > > While it is safe to use the pointer to determine if it was computed > based on the head element, either with list_entry_is_head() or > &pos->member == head, using the iterator variable after the loop should > be avoided. > > In preparation to limit the scope of a list iterator to the list > traversal loop, use a dedicated pointer to point to the found element [1]. > > Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] > Signed-off-by: Jakob Koschel > --- > drivers/crypto/cavium/nitrox/nitrox_main.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt