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: <578388B7.7080203@linux.com>
Date:	Mon, 11 Jul 2016 14:53:27 +0300
From:	Alexander Popov <alex.popov@...ux.com>
To:	Marc Zyngier <marc.zyngier@....com>,
	Thomas Gleixner <tglx@...utronix.de>,
	linux-kernel@...r.kernel.org,
	Alexander Popov <alex.popov@...ux.com>
Subject: Re: [PATCH 1/1] irqdomain: Fix irq_domain_alloc_irqs_recursive()
 error handling

On 03.07.2016 03:24, Alexander Popov wrote:
> If an irq_domain is auto-recursive and irq_domain_alloc_irqs_recursive()
> for its parent has returned an error, then do return and avoid calling
> irq_domain_free_irqs_recursive() uselessly, because:
> - if domain->ops->alloc() had failed for an auto-recursive irq_domain,
>    then irq_domain_free_irqs_recursive() had already been called;
> - if domain->ops->alloc() had failed for a not auto-recursive irq_domain,
>    then there is nothing to free at all.

Hello.
Could I have a feedback, please?

Best regards,
Alexander

> Signed-off-by: Alexander Popov <alex.popov@...ux.com>
> ---
>  kernel/irq/irqdomain.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
> index 8798b6c..6458e34 100644
> --- a/kernel/irq/irqdomain.c
> +++ b/kernel/irq/irqdomain.c
> @@ -1144,8 +1144,10 @@ int irq_domain_alloc_irqs_recursive(struct irq_domain *domain,
>  	if (recursive)
>  		ret = irq_domain_alloc_irqs_recursive(parent, irq_base,
>  						      nr_irqs, arg);
> -	if (ret >= 0)
> -		ret = domain->ops->alloc(domain, irq_base, nr_irqs, arg);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = domain->ops->alloc(domain, irq_base, nr_irqs, arg);
>  	if (ret < 0 && recursive)
>  		irq_domain_free_irqs_recursive(parent, irq_base, nr_irqs);
>  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ