From patchwork Tue Oct 27 13:49:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 313037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D657C63699 for ; Tue, 27 Oct 2020 14:11:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 56B2022265 for ; Tue, 27 Oct 2020 14:11:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807872; bh=TMvl6JqP5QWLLoIB7AQcGC1r6OKMz+DhBZQmQMC6+rA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=1f2l2zuJAm2b29N45DIg0owrU7xB1lEjX5ZVjfjyidRbMTY5A3aI/LauB+9uHa7eI FB4BRdgpJ2upRHvtoQTEWcyMmuyXoU/5HoTnoJZWXynZPVcPFpTiK54SkQqHh7X5hf HGkKqW55ueHdYyyzwg+IXLDBkQ1VhftU8x25fiUw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754527AbgJ0OFw (ORCPT ); Tue, 27 Oct 2020 10:05:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:54192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754520AbgJ0OFv (ORCPT ); Tue, 27 Oct 2020 10:05:51 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 95DD022263; Tue, 27 Oct 2020 14:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807550; bh=TMvl6JqP5QWLLoIB7AQcGC1r6OKMz+DhBZQmQMC6+rA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yw00NDlmS4C6VZCyG1dnI5GvNi80UEJYui7p/jn1t8W29qcVtM90ox3OKAjwHnXUG n6zVv9YatipLIJsiOOuoZSRXR7RsJjIIA3HY6v1HlR0WPF8/WU6RBLnVAmpIFPR3uX 1h5pposkNTS3uAWjRU62DqFmTX2atvtN6A7ejNks= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kaige Li , Jon Mason , Sasha Levin Subject: [PATCH 4.9 093/139] NTB: hw: amd: fix an issue about leak system resources Date: Tue, 27 Oct 2020 14:49:47 +0100 Message-Id: <20201027134906.550742570@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134902.130312227@linuxfoundation.org> References: <20201027134902.130312227@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Kaige Li [ Upstream commit 44a0a3c17919db1498cebb02ecf3cf4abc1ade7b ] The related system resources were not released when pci_set_dma_mask(), pci_set_consistent_dma_mask(), or pci_iomap() return error in the amd_ntb_init_pci() function. Add pci_release_regions() to fix it. Fixes: a1b3695820aa ("NTB: Add support for AMD PCI-Express Non-Transparent Bridge") Signed-off-by: Kaige Li Signed-off-by: Jon Mason Signed-off-by: Sasha Levin --- drivers/ntb/hw/amd/ntb_hw_amd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ntb/hw/amd/ntb_hw_amd.c b/drivers/ntb/hw/amd/ntb_hw_amd.c index 6ccba0d862df7..927b574e5d596 100644 --- a/drivers/ntb/hw/amd/ntb_hw_amd.c +++ b/drivers/ntb/hw/amd/ntb_hw_amd.c @@ -994,6 +994,7 @@ static int amd_ntb_init_pci(struct amd_ntb_dev *ndev, err_dma_mask: pci_clear_master(pdev); + pci_release_regions(pdev); err_pci_regions: pci_disable_device(pdev); err_pci_enable: