Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3513958yba; Tue, 16 Apr 2019 13:01:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyydlfzC7y/H2tN1BD37b6JZS3k9a2vh0dv5F+lUsYyiP2mjwqPH9odb5QvSnOrUQ9UvZ6A X-Received: by 2002:a17:902:599c:: with SMTP id p28mr21807410pli.70.1555444874543; Tue, 16 Apr 2019 13:01:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555444874; cv=none; d=google.com; s=arc-20160816; b=QbA3QZgnD3Z7hxLw+ftFtdnY1hm0Ds+Ia82xzyif/MhUk5WPTcFU+UoSczpqv2++ot 9/JfTLunsiAJQBk+6bRScHTHlKp+i1T0lhEajOynmSnFrz7UO9Rbm8a+A0A2qE8QKrLA lUaDobWgWgH8qXGVP5ADmwyDC6413Og/jrV0hb043Cew5WnQrVp4WW+iW8M8127wvX+j G48EBcTDcd2sBy3s7Gf98WgvafafOrwZ1+6Qk2o36jmRFxua30qltM2cOh/3HeznDgVo Zu7AfHCZINh1Ke5f8cNQVZG0HsX0EH5rXblSEzCOfV2PEFjNAxMU8H2fcIy3drQYa5+l CMFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=T5Lp/e5HWwrQW2h8wx1svnfD4xxXbGoUesZ1oTJmlB4=; b=Jdx6+5Z2x4i32rqyoH/tI4u9Q2dDT6H1N5u9FOfGaQjl2RK81pzkWrx+SpyJdlBI40 +8v3nJwusk9KwyfiBrM5Ymxzt4RTV/GXpuFpJLiY5+rZet4JcDHkKte3glfYHSD4kWqt LFD5+RHZP7DDKx+Nfq9cub+T1+aOwhJYpaYzaSV1dhQK6N5xuDEtiQenCpq9nbGA4YWT HWNqssSNS/ZQw5j3ikSspwIWAr567U2buRwPxEeORrWBa+Jd1vmSGLPhQ9kTdtLieElW 5GojOqmiD/qJmFqxufuD8t5RPrldPDrbYsVvQaMgFmMhMsuSAqDzCyBZthmi4AnLF0cc 20pQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si47808549ple.218.2019.04.16.13.00.58; Tue, 16 Apr 2019 13:01:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730534AbfDPT6n (ORCPT + 99 others); Tue, 16 Apr 2019 15:58:43 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:50472 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728000AbfDPT6m (ORCPT ); Tue, 16 Apr 2019 15:58:42 -0400 Received: from pd9ef12d2.dip0.t-ipconnect.de ([217.239.18.210] helo=nanos.glx-home) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hGUDs-0002wl-7d; Tue, 16 Apr 2019 21:58:28 +0200 Date: Tue, 16 Apr 2019 21:58:27 +0200 (CEST) From: Thomas Gleixner To: Wenwen Wang 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)" Subject: Re: [PATCH v2] x86/PCI: fix a memory leak bug In-Reply-To: <1555423298-6677-1-git-send-email-wang6495@umn.edu> Message-ID: References: <1555423298-6677-1-git-send-email-wang6495@umn.edu> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/.... Other than that: Acked-by: Thomas Gleixner