From patchwork Tue Jul 3 15:32:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Palmer, Thomas" X-Patchwork-Id: 140981 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1306914ljj; Tue, 3 Jul 2018 08:33:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf2eu7f9MNQmkkwq2Y9z0Ps2GXn7J4iw3JXibDrjhTZYAXOrdUAxrJTTYcqJdVQl4fbHvXV X-Received: by 2002:a17:902:74c2:: with SMTP id f2-v6mr23711780plt.260.1530631987197; Tue, 03 Jul 2018 08:33:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530631987; cv=none; d=google.com; s=arc-20160816; b=swUee/drT4hS/BG2Lh1Mp1LUrwSC9mx9eMaLYWdiM4RqIE1ckaVovuXdZIu5b00hBT JUbticNLuHw3F0UcE/XOaG6l6Ynjv0BqS3emKGahxpSo2N6HKbvVUU01Ml5UJFqES44X tR+iZNZTiENbnQNVjOLpZ2A/206I+Dsech/8yZhmafYwvHyiwz/IhHgKdOJQiyJSBdCd zGgUaECrZUiFMgkzHwDHB6mezbW9Tw8NOQJwF0jAwA0eLozgxHwYM912sfgLJUc4RWbS fNIR0mOad8AA+1+nPUaH4COZbSlzyZGJiU5gt4tz16ZMxeb/F8Ss04uktN4CvzvN9t6t SKjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=XayQw4FcabytrXH7LnZuxpledTLezWGkprWQYyX2XDQ=; b=CH3EstToPmtxLTssMH+G9YMjKm9MR25t6FPlM+vpbc7+yAhf9QPrz3C3RTNGK/EgrP ejZd6JDOpdNeqAK/w0HFb5CAZVO3n4B/WEUdA9ZDQOgWCNoz4IoWT/0d2lg/xCAtEbVI g8dZrJ6rxwXAiTf0oWW2oS6CX1372pBqvQ7u5/8u0Nlg/g22sNesFTPjHgLETWcQhW47 BMdEXWIAgHnkDh2a26fT0OYXR0td3C/6PIIkpNaT+RmFWcdreEcbWdzsj0/uHzZJ3jfE PTNT7IkZ15ij7iVfldDCXzg9Q5zxhs4cUrKBeB5eA0OVVYtwEEdzW46JdwEebNfbiYVS qdTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id v38-v6si1348152plg.283.2018.07.03.08.33.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jul 2018 08:33:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 885FE210F48CF; Tue, 3 Jul 2018 08:33:06 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: None (no SPF record) identity=mailfrom; client-ip=15.233.44.25; helo=g2t2352.austin.hpe.com; envelope-from=thomas.palmer@hpe.com; receiver=edk2-devel@lists.01.org Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9C3002098EA97 for ; Tue, 3 Jul 2018 08:33:05 -0700 (PDT) Received: from arm-build-server.us.rdlabs.hpecorp.net (arm-build-server.us.rdlabs.hpecorp.net [16.84.24.54]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id 219DBC5; Tue, 3 Jul 2018 15:33:04 +0000 (UTC) From: Thomas Palmer To: edk2-devel@lists.01.org Date: Tue, 3 Jul 2018 10:32:53 -0500 Message-Id: <1530631973-5775-1-git-send-email-thomas.palmer@hpe.com> X-Mailer: git-send-email 2.7.4 Subject: [edk2] [PATCH 1/1] MdeModulePkg/PciBusDxe: Fix small memory leak in FreePciDevice X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ruiyu.ni@intel.com, eric.dong@intel.com, star.zeng@intel.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" When cleaning the PciIoDevice, also free the BusNumberRange Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Thomas Palmer --- MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Signed-off-by: Thomas Palmer Signed-off-by: Thomas Palmer Reviewed-by: Ruiyu Ni Reviewed-by: Star Zeng and pushed the patch at 07eba7069d4c23e9b15caa1e729682a88ddf4ada. Reviewed-by: Ruiyu Ni diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index ad7a2337f578..48cf57a24f8f 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -2,6 +2,7 @@ Supporting functions implementaion for PCI devices management. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+(C) Copyright 2018 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -105,6 +106,10 @@ FreePciDevice ( FreePool (PciIoDevice->DevicePath); } + if (PciIoDevice->BusNumberRanges != NULL) { + FreePool (PciIoDevice->BusNumberRanges); + } + FreePool (PciIoDevice); }