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  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]
Date:	Mon, 28 Jul 2014 17:35:50 +0200
From:	Thierry Reding <thierry.reding@...il.com>
To:	Jisheng Zhang <jszhang@...vell.com>
Cc:	bhelgaas@...gle.com, swarren@...dotorg.org,
	linux-tegra@...r.kernel.org, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] PCI: tegra: add missing cleanup in error path and
 teardown_irq

On Mon, Jul 28, 2014 at 11:45:42AM +0800, Jisheng Zhang wrote:
> We should call tegra_msi_free() to free the msi bit if
> irq_create_mapping() fails. And we need to dispose the irq mapping
> during irq teardown.

"MSI" and "IRQ" please.

> diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
> index 083cf37..4ccc418 100644
> --- a/drivers/pci/host/pci-tegra.c
> +++ b/drivers/pci/host/pci-tegra.c
> @@ -1203,8 +1203,10 @@ static int tegra_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
>  		return hwirq;
>  
>  	irq = irq_create_mapping(msi->domain, hwirq);
> -	if (!irq)
> +	if (!irq) {
> +		tegra_msi_free(msi, hwirq);
>  		return -EINVAL;
> +	}
>  
>  	irq_set_msi_desc(irq, desc);
>  
> @@ -1222,8 +1224,10 @@ static void tegra_msi_teardown_irq(struct msi_chip *chip, unsigned int irq)
>  {
>  	struct tegra_msi *msi = to_tegra_msi(chip);
>  	struct irq_data *d = irq_get_irq_data(irq);
> +	unsigned long hwirq = d->hwirq;

I don't think we need this temporary variable, d->hwirq isn't overly
long.

With both of the above address, this is:

Reviewed-by: Thierry Reding <treding@...dia.com>
Acked-by: Thierry Reding <treding@...dia.com>

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists