lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a4ca147f-fb42-8405-a1c7-d58e8c1335a2@gmail.com>
Date:   Sat, 5 Nov 2016 08:28:48 +0100
From:   Marek Vasut <marek.vasut@...il.com>
To:     Masahiro Yamada <yamada.masahiro@...ionext.com>,
        linux-mtd@...ts.infradead.org
Cc:     Boris Brezillon <boris.brezillon@...e-electrons.com>,
        Brian Norris <computersforpeace@...il.com>,
        Richard Weinberger <richard@....at>,
        linux-kernel@...r.kernel.org, Bjorn Helgaas <bhelgaas@...gle.com>,
        Linas Vepstas <linasvepstas@...il.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Enrico Jorns <ejo@...gutronix.de>,
        David Woodhouse <dwmw2@...radead.org>,
        Graham Moore <grmoore@...nsource.altera.com>
Subject: Re: [PATCH] mtd: nand: denali_pci: add missing pci_release_regions()
 calls

On 11/02/2016 06:13 PM, Masahiro Yamada wrote:
> 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 <yamada.masahiro@...ionext.com>

Reviewed-by: Marek Vasut <marek.vasut@...il.com>

> ---
> 
>  drivers/mtd/nand/denali_pci.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> 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 = {
> 


-- 
Best regards,
Marek Vasut

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ