Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3580908yba; Tue, 16 Apr 2019 14:31:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyN0p37ZMHOVv0RPa6fP8wLboU878Yf8CNnQ5c4TpOdMI6DClqSdYk4nTEOMfFZyxMBCBvz X-Received: by 2002:a62:1701:: with SMTP id 1mr86067417pfx.120.1555450285287; Tue, 16 Apr 2019 14:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555450285; cv=none; d=google.com; s=arc-20160816; b=ir3J9dJiqGdEbav9IAn4Q9afNkn4X2EwxJHaSPaEwOJCArQwuG6aliPk0h3qdC2pJg hwE1D31QA0XlVKugoOrRb/BXDIy72sZXkeXdRVNYzRW20lYzOVYzICSoLMZN5Dmu7kH1 gjpvs1J61uWYQgHPW1FykBYbwutSlU+oP0EVwN2f8jRBGCYI11Xg8xq8+1nPOMLzXICY 7wEtLK/XZVGXKQfDvB+7VrkXgylaGdl4MaQRSi+N47W3/U5iXLzwGFjZ8ONkl4uTwSBO qWjGcnUO8XSlpa/lrnBpEUvlNZSDVw3r0azkKebM/aMy/Z+4kMkUCC7JynB/3hcQwN8H aULg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=SejhEAdsy0bjqdzzcUyFRadn51Pa9bkvFtRS16XL79Q=; b=0eorc3pbQimJuNmkmXnbLEkjHyQ5e06MGGObmGjUVD6HliVNwOKCMfmkif9hDiCwNi YnPQAZ91FhVOtHIs0/A4fLa6HJ3VSm0gLj5F07U6OW0CH9cz0qLoXbQuRwEupq8ASHaa EIUUIW710kPy2qX5DsfcZRZYo6iRs1htRs7G8tMbxUm/BLYGUWF1IRRtl/cC0nRxbVDo 0oQsEyXwv2yIPLggdqTJSujJJqlkLLfv/8IcsUEGfFnC8EGi1JiIC6zur33tCgiKly7s qMfVhLe6zMSq10seBiU/cPSOBlB7Kv82ffz5RwumNklRoyX4axmTm/vmNKGrubsbAYXu rksw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umn.edu header.s=20160920 header.b=J76nAIpK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umn.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12si41793013pgq.53.2019.04.16.14.31.09; Tue, 16 Apr 2019 14:31:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@umn.edu header.s=20160920 header.b=J76nAIpK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umn.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729498AbfDPVaa (ORCPT + 99 others); Tue, 16 Apr 2019 17:30:30 -0400 Received: from mta-p3.oit.umn.edu ([134.84.196.203]:49070 "EHLO mta-p3.oit.umn.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726986AbfDPVaa (ORCPT ); Tue, 16 Apr 2019 17:30:30 -0400 Received: from localhost (localhost [127.0.0.1]) by mta-p3.oit.umn.edu (Postfix) with ESMTP id C8522712; Tue, 16 Apr 2019 21:30:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=umn.edu; h= content-type:content-type:subject:subject:message-id:date:date :from:from:in-reply-to:references:mime-version:received:received :received; s=20160920; t=1555450228; x=1557264629; bh=SejhEAdsy0 bjqdzzcUyFRadn51Pa9bkvFtRS16XL79Q=; b=J76nAIpKpewq74JpuDHhvVJxpy brTijYCMMqPYaKt8wMP1c3BRQpYhpgwoSqK+Cwwz1N0muZeqsjfVGtuYsIYH66E1 8uOt/EXw2qpQgniQUwqcKM2OFj9fJTRg23ELwzOa/SsBjSOEQ7IillAN6ZqbLyqS iJu679fHPxJ+8KdtrzL8ww5H2VpXUxt1d07r5SRrpYo/D3dC1ghdEwjgyVmhb6MG 1etqJbSydMxKlG2vSbU1W3FwEGusuGZ9xd7VzPp1SzZ/9dPLX7VpXdBkDulogq+a PDEmRNGQd0M6D+hZcMkyyBATaZd8C/bKeamFG5GNG4brv4x65dujZPRG1GTQ== X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p3.oit.umn.edu ([127.0.0.1]) by localhost (mta-p3.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MaX3WBuGIlUy; Tue, 16 Apr 2019 16:30:28 -0500 (CDT) Received: from mail-it1-f182.google.com (mail-it1-f182.google.com [209.85.166.182]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: wang6495) by mta-p3.oit.umn.edu (Postfix) with ESMTPSA id 9973C6EA; Tue, 16 Apr 2019 16:30:28 -0500 (CDT) Received: by mail-it1-f182.google.com with SMTP id q14so1219478itk.0; Tue, 16 Apr 2019 14:30:28 -0700 (PDT) X-Gm-Message-State: APjAAAW9bfuRhenEsITYD0WSOioh1Y3weKy1IASFaqj1L6ATPwIfr0R/ NpRDHSQ7Rw/uZ3Duc3xRvH1HpXR69ei2otzIROA= X-Received: by 2002:a24:6b92:: with SMTP id v140mr27663327itc.161.1555450228421; Tue, 16 Apr 2019 14:30:28 -0700 (PDT) MIME-Version: 1.0 References: <1555423298-6677-1-git-send-email-wang6495@umn.edu> In-Reply-To: From: Wenwen Wang Date: Tue, 16 Apr 2019 16:29:52 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] x86/PCI: fix a memory leak bug To: Thomas Gleixner Cc: Bjorn Helgaas , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "open list:PCI SUBSYSTEM" , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Wenwen Wang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 16, 2019 at 3:33 PM Thomas Gleixner wrote: > > On Tue, 16 Apr 2019, Wenwen Wang wrote: > > > In pcibios_irq_init(), the PCI IRQ routing table 'pirq_table' is firstly > > found through pirq_find_routing_table(). If the table is not found and > > 'CONFIG_PCI_BIOS' is defined, the table is then allocated in > > pcibios_get_irq_routing_table() using kmalloc(). In the following > > execution, if the I/O APIC is used, this table is actually not used. > > However, in that case, the allocated table is not freed, which can lead to > > a memory leak bug. > > s/which can lead to/which is/ > > There is no 'can'. It simply is a memory leak. > > > To fix this issue, this patch frees the allocated table if it is not used. > > To fix this issue, free the allocated table if it is not used. > > 'this patch' is completely redundant information and discouraged in > Documentation/process/.... > Thanks for your suggestions, Thomas. I will revise the commit's message. Wenwen > Other than that: > > Acked-by: Thomas Gleixner