Received: by 10.192.165.148 with SMTP id m20csp4786058imm; Tue, 24 Apr 2018 08:23:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx491IOckKQXHxWh/jcIR1xUo8rn3dgqxiyJXtwgT7RYhgHJGJROohjr7g6haKeK8XtqPMn1K X-Received: by 10.98.16.74 with SMTP id y71mr16760424pfi.188.1524583395308; Tue, 24 Apr 2018 08:23:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524583395; cv=none; d=google.com; s=arc-20160816; b=b45OscZUnotH4np61oKwNpP0IZs3epocATD25irC44sqLycrA9s98AQfyE5+QUTu+p 53an+Eh00OMMuMWhGYaWvmTGuLRq8g502xWGmNJ5mMfV8XOHS47Vy8txrYqobR3raWuR HZrxlWZ2P9pC7FGvOTUZLgXL8aaPu4s4NHR43kKqtvEfovlxUGEkwanX7uog45F0Dy6I GzoLqg/neaY9cjHU3zrsirTyaKXsujgRvSeAVHGrCAuJRxASUwbNp4gBU7yEW9EYyK/F S7kW5NOH28Yo7gutBd5rkijVLBlMrU1vlbCOAat3/iKP6U9syFSpYKLc+q9hBGuIZh6P gbfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:to:from :arc-authentication-results; bh=qIrPOYdKwq19Y5ELnpi6DYTWKx8SiNTgOFdOhUKkuTA=; b=kP319Pw2QUagTDI0qdzRSENR3eJmHT3rNqOuFGhdcjqn38MEjXe9COs0v4dG1SwwZL 2al5qtgfbiZVnooZ6jAmhelNb802BnmhNyeKHUVKNM25wrrcsK52y/NpC+VlqpyKBLhW PAF3jOuVSOsTzmiaSMETFOv8Nyj9qmCOvnlQu4X/qTr1HZqHLZguBwbGXqSFtjyvhx2X 6Sa3vAsrkYaUYa5CdDZAujHT1T0HrGF0nTq7oVcxE43ifYm+jfhzoaCzvoHaZEOay9Ey I4Z5kOsJCuXsxKPIQpZQ1S7nyhVoXiUkLLCYgJ9JFEyOvwHU74QuCdaKfCHXp4RLHvTe TG0w== 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 b4-v6si8990225plk.327.2018.04.24.08.23.00; Tue, 24 Apr 2018 08:23:15 -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 S1751356AbeDXPVb (ORCPT + 99 others); Tue, 24 Apr 2018 11:21:31 -0400 Received: from goliath.siemens.de ([192.35.17.28]:60153 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750766AbeDXPV1 (ORCPT ); Tue, 24 Apr 2018 11:21:27 -0400 Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w3OFDir2031288 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Apr 2018 17:13:44 +0200 Received: from md1f2u6c.ad001.siemens.net (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id w3OFDhek031216; Tue, 24 Apr 2018 17:13:44 +0200 From: Jan Kiszka To: Bjorn Helgaas , Linux Kernel Mailing List , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/6] PCI: Fix memory leak of devm_pci_alloc_host_bridge Date: Tue, 24 Apr 2018 17:13:38 +0200 Message-Id: <2a083b46d55687d01d43d4013cfb957cb3720db5.1524582822.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jan Kiszka devm_pci_release_host_bridge_dev failed to release the resource list. Fixes: 5c3f18cce083 ("PCI: Add devm_pci_alloc_host_bridge() interface") Signed-off-by: Jan Kiszka --- drivers/pci/probe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index ac91b6fd0bcd..eccf204c9160 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -526,12 +526,14 @@ static void devm_pci_release_host_bridge_dev(struct device *dev) if (bridge->release_fn) bridge->release_fn(bridge); + + pci_free_resource_list(&bridge->windows); } static void pci_release_host_bridge_dev(struct device *dev) { devm_pci_release_host_bridge_dev(dev); - pci_free_host_bridge(to_pci_host_bridge(dev)); + kfree(to_pci_host_bridge(dev)); } struct pci_host_bridge *pci_alloc_host_bridge(size_t priv) -- 2.13.6