Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1109161imm; Wed, 1 Aug 2018 10:19:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpck1GLcU8XcCkeD2PaWwY9xfDZm3XU/MGOZ3Dr5TYHUtLBJvlOWAIc3+qCQcREnxI9mlwo2 X-Received: by 2002:a17:902:b40c:: with SMTP id x12-v6mr25898897plr.163.1533143974147; Wed, 01 Aug 2018 10:19:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533143974; cv=none; d=google.com; s=arc-20160816; b=GrNY2B9JIhhOXkVapEf+RktMI8J6xzk0Btw9mYeLGn0wssRIhKfp3kAAYISan4+3IH PWyIgRh8KDyyHrTav4sWPYKZbYRfNeuqEgSYWv1gU6NDA61OC5hnMkhgpUIc+kXYGCY2 zrp0+Xh/nQVRVgcapKsSjH8nNTbJFv5YeYoiT6PwBFh9X6K19dbeI6eDhaTkHPduN2wC g/zlJsC93XfzL7PtIs5rP0bW0JGJP5fXR3XYy6JV2G/jo6FGVQWQI4B14n3EJxJ9lspY oy+L83d78iKypnIXrE3Mrse+zXcm15RsaeiOsZpyBQXGyFOpPHYIPY2sl66Hww+05Ksz uhAg== 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 :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=FIzhWOFb1FVNTvMxMkQRcJyGNuNqLRsSFoDV2/hXrOc=; b=fQF3B7BSp3ynewTUVUvTckGcF+B92kyfj7UTgR/PvmOayk/YWfgzsz6SAzTDdzHjLV oA3QwIPhv5/PX9KmW0MiwNpye/DjfKL+5iG1RYLEThm0Nyw96M847yoK8cpGgjHQ30lr d1kDCprVTe5eZgEDVh3LKW7Ak8uLQ+KinOMIITAb6BAo+02pkSpEaTFhnlQoMQIW2R3u Q03gwnlMkdQCoQDg0acO8FBZLr4jy7mXHY75nLlUpJNQExHU/6s3l0SapnZtVOEhTB9I /NFgMwGe2wRGDxPfkI3UhmJZcNe3Dsz+MGXofIyW81GN74t4GtXijhbrdiARgrf9+Rnn N9rA== 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 q126-v6si17285422pfb.277.2018.08.01.10.19.19; Wed, 01 Aug 2018 10:19:34 -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 S2404648AbeHATD6 (ORCPT + 99 others); Wed, 1 Aug 2018 15:03:58 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46302 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403901AbeHATD6 (ORCPT ); Wed, 1 Aug 2018 15:03:58 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4EEFAC96; Wed, 1 Aug 2018 17:17:18 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Kiszka , Bjorn Helgaas , Sasha Levin Subject: [PATCH 4.14 070/246] PCI: Fix devm_pci_alloc_host_bridge() memory leak Date: Wed, 1 Aug 2018 18:49:40 +0200 Message-Id: <20180801165015.057008313@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jan Kiszka [ Upstream commit 3bbce531788719749520f28052cabdef16af6b16 ] Fix a memory leak by freeing the PCI resource list in devm_pci_release_host_bridge_dev(). Fixes: 5c3f18cce083 ("PCI: Add devm_pci_alloc_host_bridge() interface") Signed-off-by: Jan Kiszka Signed-off-by: Bjorn Helgaas Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/pci/probe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -516,12 +516,14 @@ static void devm_pci_release_host_bridge 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)