From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AF5AC4338F for ; Mon, 2 Aug 2021 14:16:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 635A860F4B for ; Mon, 2 Aug 2021 14:16:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238236AbhHBORB (ORCPT ); Mon, 2 Aug 2021 10:17:01 -0400 Received: from 8bytes.org ([81.169.241.247]:53234 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234708AbhHBONk (ORCPT ); Mon, 2 Aug 2021 10:13:40 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id E41C83C3; Mon, 2 Aug 2021 16:13:29 +0200 (CEST) Date: Mon, 2 Aug 2021 16:13:27 +0200 From: Joerg Roedel To: Luigi Rizzo Cc: Will Deacon , linux-kernel@vger.kernel.org, David Rientjes , rizzo.unipi@gmail.com, Suravee Suthikulpanit Subject: Re: [PATCH] amd/iommu: fix logic bug in amd_iommu_report_page_fault() Message-ID: References: <20210731192637.3653796-1-lrizzo@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210731192637.3653796-1-lrizzo@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 31, 2021 at 12:26:37PM -0700, Luigi Rizzo wrote: > amd_iommu_report_page_fault() has two print paths, depending on whether or > not it can find a pci device. But the code erroneously enters the second > path if the rate limiter in the first path triggers: > if (dev_data && ratelimit(A)) { A; } else if (ratelimit(B)) { B; } > The correct code should be > if (dev_data) { if (ratelimit(A)) { A;} } else if (ratelimit(B)) { B; } > > Signed-off-by: Luigi Rizzo > --- > drivers/iommu/amd/iommu.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) Thanks, but I queued this patch already: https://lore.kernel.org/r/YPgk1dD1gPMhJXgY@wantstofly.org Regards, Joerg