Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3186084ioo; Tue, 24 May 2022 15:33:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmEtyxQV3/m7lUQDQOJdHK2EB1dW0DrOsFkCIoxpXAvhM5u6+Yb7sBRcb58MNARh6DrHzR X-Received: by 2002:a17:906:9c82:b0:6df:c5f0:d456 with SMTP id fj2-20020a1709069c8200b006dfc5f0d456mr26500740ejc.287.1653431614969; Tue, 24 May 2022 15:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653431614; cv=none; d=google.com; s=arc-20160816; b=Kc4DpK8lFssoysASbKzzcUEk4Y98InqPydq+Puje0gdZWXbRgZuzPq6BkCGGPNCa1n NvBB/l5nI/4dUEZCTS097Md2uF04LCacPEHAv9iM4EuNcYCSd+8Kft3jb6cqI6O5Zt4L 5ALi3wCuMIr4t8Zh0fwWsDOY+9clIGko/pK2OChlb94rt9UM0N7St3WJ6ce08C064PTh AGHaiFTN951JM/7dL+iZC8p/gZLUUM0YMuhMnchbMHcLOqme6kXNH/Qu+LaItnCw1mO3 3ZZETvHV+cqFPnPHzd0b6M2RYK0UbbLwqb5Z3WEmITH2dLg5Ft5Pic9JQmgwDF88zhMa 9VIA== 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:date :message-id:subject:references:in-reply-to:cc:to:from; bh=FxYGOh8yxL/EhjBsrFuiCwJYCfBoIOW+F3KaLcfLA9k=; b=ZJ94MvHjDYA8gXAozF3AgJ9EvhJlzBYaDGtL9aEbulx52w/MIxsh0AmWxSzdrUmA57 SEc/dbi3o10mpTW+Sa9W6vSeLGUqYxTd9ctp16dDrduy1+4gkIe3j37cM6I+MqGoH8zT klJ1unPtt9hIlW+DTuK/bI4NixC0VRDi4MIiTEgqMVsEb03ZZUQCx73xiIAkZSKmuCsw /WHmZ7vUlAr9cSkfIUghfb12wnKefFhQ/vryfXrCDuBSOv5er+PJ1fo7nXKGzZgzZ1gj WwCxv1wLU0+vxn+2279HCp4ge4h8Dar8wFr6M1b+CJ87Tg48HKdTfnU5z1EoXBqsioIJ Htag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 e10-20020a056402190a00b0042b370a1553si4318537edz.67.2022.05.24.15.33.09; Tue, 24 May 2022 15:33:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236417AbiEXKyK (ORCPT + 99 others); Tue, 24 May 2022 06:54:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236409AbiEXKyG (ORCPT ); Tue, 24 May 2022 06:54:06 -0400 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 214A16D4DE; Tue, 24 May 2022 03:54:06 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4L6rfh119Lz4yT3; Tue, 24 May 2022 20:54:04 +1000 (AEST) From: Michael Ellerman To: akpm@linux-foundation.org, bharata@linux.ibm.com, linuxram@us.ibm.com, Felix.Kuehling@amd.com, mpe@ellerman.id.au, paulus@samba.org, benh@kernel.crashing.org, maciej.szmigiero@oracle.com, maz@kernel.org, david@redhat.com, Xiaomeng Tong , liam.howlett@oracle.com, apopple@nvidia.com Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, linuxppc-dev@lists.ozlabs.org In-Reply-To: <20220414062103.8153-1-xiam0nd.tong@gmail.com> References: <20220414062103.8153-1-xiam0nd.tong@gmail.com> Subject: Re: [RESEND][PATCH] KVM: PPC: Book3S HV: fix incorrect NULL check on list iterator Message-Id: <165338950780.1711920.5897036006589907982.b4-ty@ellerman.id.au> Date: Tue, 24 May 2022 20:51:47 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org On Thu, 14 Apr 2022 14:21:03 +0800, Xiaomeng Tong wrote: > The bug is here: > if (!p) > return ret; > > The list iterator value 'p' will *always* be set and non-NULL by > list_for_each_entry(), so it is incorrect to assume that the iterator > value will be NULL if the list is empty or no element is found. > > [...] Applied to powerpc/topic/ppc-kvm. [1/1] KVM: PPC: Book3S HV: fix incorrect NULL check on list iterator https://git.kernel.org/powerpc/c/300981abddcb13f8f06ad58f52358b53a8096775 cheers