From patchwork Wed Nov 2 17:13:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 80518 Delivered-To: patch@linaro.org Received: by 10.80.170.210 with SMTP id r18csp219353edc; Wed, 2 Nov 2016 10:15:31 -0700 (PDT) X-Received: by 10.98.80.130 with SMTP id g2mr8553097pfj.179.1478106931643; Wed, 02 Nov 2016 10:15:31 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id bw7si3423285pad.259.2016.11.02.10.15.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Nov 2016 10:15:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c1z87-0006zS-5q; Wed, 02 Nov 2016 17:15:15 +0000 Received: from conuserg-08.nifty.com ([210.131.2.75]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c1z7x-000614-BQ for linux-mtd@lists.infradead.org; Wed, 02 Nov 2016 17:15:10 +0000 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-08.nifty.com with ESMTP id uA2HDqeL005857; Thu, 3 Nov 2016 02:13:57 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com uA2HDqeL005857 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1478106837; bh=RoS1GijmNbtJRSDA/uJRYTV7uCHg87TiiTUNr8hePPU=; h=From:To:Cc:Subject:Date:From; b=Uee7KyFuyGaFdOKI9FduwR745qb+fkkDWtes9GSdegzoCkd1WLgLcB9CiXsi+I6AQ KlF7fmCeH8utLHJ4pNlOdD3t5YQiRmTbnCuFJKbnX1b4a0wGLlKN29Q2BuJI2JQbcQ Xa6ca4wSilN9zhy+Ii0ZcecSe2J9rwYnX6xuoKmwiqoGaPseEtN7BrFazqDKJjdQ5p et746sOqO2lDwNyl18gMOnyxHoFK2PiIZrbgYSTY0lQGXrmrSbyD52z3AsM+/hbKkD wVSII5xcvtV5zudva6Y2qxb5/Dt1blssrBOh1S41XfE/ASMZOJY83TPEz7UgtYa6p4 Vpc+RbskL/CMg== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [PATCH] mtd: nand: denali_pci: add missing pci_release_regions() calls Date: Thu, 3 Nov 2016 02:13:10 +0900 Message-Id: <1478106790-10399-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161102_101505_982942_121C51FA X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , Brian Norris , Richard Weinberger , linux-kernel@vger.kernel.org, Masahiro Yamada , Bjorn Helgaas , Linas Vepstas , Andy Shevchenko , Enrico Jorns , David Woodhouse , Graham Moore MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org The probe function calls pci_request_regions(), but I do not see corresponding pci_release_regions() calls. While we are here, rename the jump labels to follow the guideline "Choose label names which say what the goto does" suggested by Documentation/CodingStyle. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/denali_pci.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) -- 1.9.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/denali_pci.c b/drivers/mtd/nand/denali_pci.c index de31514..be8152f 100644 --- a/drivers/mtd/nand/denali_pci.c +++ b/drivers/mtd/nand/denali_pci.c @@ -76,28 +76,31 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) denali->flash_reg = ioremap_nocache(csr_base, csr_len); if (!denali->flash_reg) { dev_err(&dev->dev, "Spectra: Unable to remap memory region\n"); - return -ENOMEM; + ret = -ENOMEM; + goto release_regions; } denali->flash_mem = ioremap_nocache(mem_base, mem_len); if (!denali->flash_mem) { dev_err(&dev->dev, "Spectra: ioremap_nocache failed!"); ret = -ENOMEM; - goto failed_remap_reg; + goto unmap_reg; } ret = denali_init(denali); if (ret) - goto failed_remap_mem; + goto unmap_mem; pci_set_drvdata(dev, denali); return 0; -failed_remap_mem: +unmap_mem: iounmap(denali->flash_mem); -failed_remap_reg: +unmap_reg: iounmap(denali->flash_reg); +release_regions: + pci_release_regions(dev); return ret; } @@ -109,6 +112,7 @@ static void denali_pci_remove(struct pci_dev *dev) denali_remove(denali); iounmap(denali->flash_reg); iounmap(denali->flash_mem); + pci_release_regions(dev); } static struct pci_driver denali_pci_driver = {