Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp173340pxx; Wed, 28 Oct 2020 01:34:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQDXKwCfBaWFOFRbNg1yd5vViQTkBQFdmx9EpsywIhpsuHex324F8v10oyxBpBhEATJ4+p X-Received: by 2002:a50:b746:: with SMTP id g64mr6757755ede.380.1603874077449; Wed, 28 Oct 2020 01:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603874077; cv=none; d=google.com; s=arc-20160816; b=TBzLvkjwTSbuiQ66/3LMDmM3fPZfaYQsdKWLDzloO7IELQso7iiJ6I4+GrGlcZ0tGD yxk71dt+qbjB/tiMgQtIUlXIzfHP9uEuV8rQOSxhRLXbxIKFAvrigaiL4VExx9PpdvWQ GHlCgcVGnaXOmHDVFxHpOsOeASX5+Vv6rT49NbQWNAwQ3kTAiDoESUSOhUGloVY/5xxY r2gwMXbmGKVuSajkogZGKD9uKY1Kt4SUyi/1JAHBW4DXfu+FlabPhZRnzLYm1OaJPJrk CHvVhPY3cjgQCfudOs+wziKySHPGGrkdOrN+FXmgM+CAHulRxf+g07vOhxsIbf4zxg6G o7pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ouu8vz3IKyTSrBeCY5jgwVPZWwqECfc5dkJojdNKQ3o=; b=sSSlLlCv2rXrngKQ/+rZqcKYGnCfdaVthm0yswdeGiATCcdDjAohk5wSJdSHC+yKdV ZttqxLcWB4ahcBhxJIAEcBG5+9z1DvIRNCHx4BatKUCUBR97NTtV3M4LESeN4CYqHwNk VBcddsoKgH4veeJ+wWh+foyGgPSN0Jdk0HvMBdqgtIWw5+7lloTHJ0/8D7G/R2S8nxuI kaO/Z+bw3V3m3+2KYZK6H1MK4b7f1/WUFkjmJLwbYnjxF7aAcxUjz16xocotk7KT037a t1zoyKiW8eBM/MaWokBSVx/TNp7zMK4vGhwoW4BrDAN8KMIVVV8x5NHTixJ/rlTiWerr qZag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yw00NDlm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y19si2789537ejd.730.2020.10.28.01.34.15; Wed, 28 Oct 2020 01:34:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yw00NDlm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754556AbgJ0OF5 (ORCPT + 99 others); Tue, 27 Oct 2020 10:05:57 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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: -- 2.25.1