From patchwork Tue Oct 27 13:54:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 312821 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 30552C83016 for ; Tue, 27 Oct 2020 14:52:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DABCA22265 for ; Tue, 27 Oct 2020 14:52:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810350; bh=14avgr7uOagY9815MAlWXFNSkPWO7CWBf62NH8MEKlM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=sra6EEB9iH9SfrlJTKKr5dDSYXGYR7kqSS/yOTTSSYHJyo1tbkNBJnKDFMJhFEsab kJHvz/LoOqsYoW7rC2RAf0QRR+2NA5Bes7wAXHLXOaZO5ysGRPdZOpw9zHLA2B/xqU hB+gUaYzJzTZhta50O1iyC5wKvILP0UFxfwftICg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762946AbgJ0Ooj (ORCPT ); Tue, 27 Oct 2020 10:44:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:44478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762936AbgJ0Ooj (ORCPT ); Tue, 27 Oct 2020 10:44:39 -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 391F12222C; Tue, 27 Oct 2020 14:44:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809878; bh=14avgr7uOagY9815MAlWXFNSkPWO7CWBf62NH8MEKlM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dGT4UWoqfp2DV97fGfQ19IWy4rPRLteP208hBVjOkVC3bOi9E+xalm2AEMdR9F5Cm qoklxrzjJwEGW3JsAldiYyMTMsK1pY7OT2o4rJucPzDqT/UYfxKfRFlm1HBHBlcvW8 bIbK77tRrKkDaYVwxjfrz6faf/FPv7t4OymvjiHg= 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 5.4 320/408] NTB: hw: amd: fix an issue about leak system resources Date: Tue, 27 Oct 2020 14:54:18 +0100 Message-Id: <20201027135509.873582937@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 156c2a18a2394..abb37659de343 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: