From patchwork Tue Oct 27 13:54:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 312952 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=ham 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 8DE48C55178 for ; Tue, 27 Oct 2020 14:25:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52CF9207BB for ; Tue, 27 Oct 2020 14:25:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808736; bh=LltNz5blzkG3eB0hrIl+yG/F6kFORKwk3dmgl+7H1wg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=VREvWhhGxsS/mhtskWvbTRt3sg5UpMhOPVUm5ZiXITxlr4bckklnKPFrf1rbtkPxT XY2F7TcnGYqZgBCqeuXQnD5J/kT0sihxddTQ2UvBmW0UUlQCVQ6qadEuOBxaMMGv+w OCNFFuwCby6pjwWgwc2tNX1FZt1WwR5YdQPR2deo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758925AbgJ0OZf (ORCPT ); Tue, 27 Oct 2020 10:25:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:50972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754067AbgJ0OZb (ORCPT ); Tue, 27 Oct 2020 10:25:31 -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 0B2FC2072D; Tue, 27 Oct 2020 14:25:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808731; bh=LltNz5blzkG3eB0hrIl+yG/F6kFORKwk3dmgl+7H1wg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AtzDkDT6kxyuM/dbEHuSp2cBVKMiaijzQR0w0soqM9keewYI+VVxUi+6ENMZqTx7i dGCkHsEsGxoAgUU2grPuyXytJD5OY5kMWfkgTH2G/HafNnOac63p7mNVeK1itoObaT AX7Ilfupen5U1FReW4yuLWWu0YxORuq6j75kZC3Y= 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.19 202/264] NTB: hw: amd: fix an issue about leak system resources Date: Tue, 27 Oct 2020 14:54:20 +0100 Message-Id: <20201027135440.157598822@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135430.632029009@linuxfoundation.org> References: <20201027135430.632029009@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 efb214fc545a2..0b1fbb5dba9b6 100644 --- a/drivers/ntb/hw/amd/ntb_hw_amd.c +++ b/drivers/ntb/hw/amd/ntb_hw_amd.c @@ -1036,6 +1036,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: