From patchwork Fri Aug 4 03:32:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harunobu Kurokawa X-Patchwork-Id: 9880377 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C5ABB603B4 for ; Fri, 4 Aug 2017 03:34:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C08B127F17 for ; Fri, 4 Aug 2017 03:34:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B543128515; Fri, 4 Aug 2017 03:34:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A52E27F17 for ; Fri, 4 Aug 2017 03:34:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751921AbdHDDeG (ORCPT ); Thu, 3 Aug 2017 23:34:06 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:46013 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751910AbdHDDdf (ORCPT ); Thu, 3 Aug 2017 23:33:35 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 04 Aug 2017 12:33:33 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id B60B5506A2; Fri, 4 Aug 2017 12:33:33 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.41,319,1498489200"; d="scan'208";a="252410364" Received: from mail-pu1apc01lp0020.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.20]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 04 Aug 2017 12:33:33 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=VXCbZ2shHiV1tBt948+PLFUk4R19dFEvOBKRt99yKkE=; b=k1U4gRW6Fz6/r4Q++XGtwGTtGC9KBFXSkd62DZ3i/eb0VBVgDrFjvzV17j/5KqzY5E9MBkCycqDb340O2GAyuu8EjH5a1re4dGUNqivngpIenDHl1pCy0xF7tI4N09MpjUsMUrcdjMUDssxfpe5ASb9WO0pnb/tMOGY5yy1h9xg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.138) by PS1PR0601MB1467.apcprd06.prod.outlook.com (2a01:111:e400:c48d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1304.22; Fri, 4 Aug 2017 03:33:30 +0000 From: Harunobu Kurokawa To: horms@verge.net.au, bhelgaas@google.com, linux-pci@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Harunobu Kurokawa Subject: [PATCH v2 2/2] PCI: rcar-pcie: Fix memory leak when no PCIe card is inserted Date: Fri, 4 Aug 2017 12:32:55 +0900 Message-Id: <20170804033255.27171-3-harunobu.kurokawa.dn@renesas.com> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20170804033255.27171-1-harunobu.kurokawa.dn@renesas.com> References: <20170804033255.27171-1-harunobu.kurokawa.dn@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: OS2PR01CA0123.jpnprd01.prod.outlook.com (2603:1096:602::17) To PS1PR0601MB1467.apcprd06.prod.outlook.com (2a01:111:e400:c48d::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7aea9732-69e5-4ec9-f5a2-08d4dae99434 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:PS1PR0601MB1467; X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1467; 3:urrlwseAueiWXHLnX5rYh21oJlsu+jiYRJyNBYeErjwlAbNThY6SyUkwTuEGD9Kr6guZVvDY0XQbJYdYaoTRGKQZIczUQMgLR/2mZMoGfJ+QU0qBRMr4v8gwOckJI+yN2EBfetVC/xwEtdvjCXwAsytFX8vND5hBCFJ77NNDRAo1ekVADGILONE+zCa2pthCZb2WR+194bVfg21TFKR5gWsHNCTyaOJRsFzQ51BwAjMxyeTk23Kc5G01uLF5t3ZZ; 25:OzVHq308+1EpYhcaZMTegZNgPfqui+eMOcCHgqanjxc3ljC4nnNOfC444x8ILBKs8PvHumU1CqXr5y2AcNq/2WH7kH379FfnOpMsrlXW6nbUzTJVq+8rvsLkSZW35izDVgXYcTbNnZc4AK44kTYIwwRkGAVKockOWqEcJdquQCo9d+AWrgc4o7GJahkpCqrYoaIjL92dcnDTyi1UUye0HrNTNPJRskVTEXWlK+JW0W4Mt0nAQPUVTD3kkKKOR296YXuKsa+EW/Wq18gNvZDfPZgN5aKyY5KOdN+vPpbJXAllQt0FVXs1MqZRqbGEXuNjW2tasydXdVNpyLHBS6I+vw==; 31:3e1EE0UZoENvs64lvKpCZ6v6xE8fVxs95+PXm8P7pJA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oft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(6055026)(6041248)(20161123555025)(20161123558100)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:PS1PR0601MB1467; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:PS1PR0601MB1467; X-Forefront-PRVS: 0389EDA07F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(7370300001)(6009001)(6069001)(39400400002)(39850400002)(39410400002)(39860400002)(39840400002)(39450400003)(189002)(199003)(33646002)(6486002)(305945005)(105586002)(7736002)(50466002)(50226002)(78352004)(42186005)(4326008)(106356001)(103116003)(25786009)(68736007)(2906002)(36756003)(6506006)(6666003)(81166006)(81156014)(498600001)(76176999)(50986999)(8676002)(2950100002)(42882006)(48376002)(110136004)(38730400002)(101416001)(107886003)(66066001)(6512007)(7350300001)(5003940100001)(47776003)(53936002)(189998001)(97736004)(5660300001)(1076002)(3846002)(6116002)(3720700003); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR0601MB1467; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:0; A:0; LANG:en; Received-SPF: None (protection.outlook.com: localhost.localdomain does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; PS1PR0601MB1467; 23:yv7QKmajwCKHlJEdpVqqFoFcbEpM3rO+wBRfIj8?= =?us-ascii?Q?+ha+59mWRl8wQxhfry7yulBbTv/ikJix7wtvoM2q80LoVuFJqZTimJWCeOuc?= =?us-ascii?Q?dwQ+H40zT3QZvhH73V8S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kHayYeL1dAayUlkcfrZkuwmWFryfjYxBLQhTnwEMVuZak68pXTEFXlf8VX80q/z3+WWYZJcFgku7EgB8=; 7:O3RE/8X7wthjYd/tXvwrrirgpLtCy/P4MMtQKP/2qAcZZ1vmGU9O6bNG66/pX9F3iVvrnXJu4zoiuYk3cUlBimeEJK6G8BDmCsvQ3O8f7N17+VZHywLro/mhXlboPHQb9Pv+dDolMXOviyg8YkTcRuabB/lCGcMThXP/G/rDarBbvU4BsxmDzIqEwsOp683gfMvcAbbUi/hoFAuYPl2AKukUzlbHM3d9sC2wesc0iyY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1467; 20:UuhWdWsBLXLo1PyLEW0XVEHIGPu7LPgkxiU7MTeXCdlwIXO2TGWNEPslwIodTvBkouv7UDbcXp45vyEAX3hi5Vuz6Eehf5BOr80ubtcKTO5DbyO832pYVNTgB1jVxxBVwen3zCx2m22Pko0P+gXRNzMngvldic1ckEHyAH5Ec7Y= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2017 03:33:30.9611 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR0601MB1467 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When no PCIe card is inserted, there is a memory leak as pci_free_resource_list is not called before returning. Signed-off-by: Harunobu Kurokawa --- drivers/pci/host/pcie-rcar.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c index 6b73981..70b487c 100644 --- a/drivers/pci/host/pcie-rcar.c +++ b/drivers/pci/host/pcie-rcar.c @@ -1196,6 +1196,7 @@ static int rcar_pcie_probe(struct platform_device *pdev) err_free_bridge: pci_free_host_bridge(bridge); + pci_free_resource_list(&pcie->resources); return err; }