Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1440703 > unrolled thread

Re: [PATCH 1/1] irqdomain: Fix irq_domain_alloc_irqs_recursive() error handling

Started byMarc Zyngier <marc.zyngier@arm.com>
First post2016-07-11 17:20 +0200
Last post2016-07-11 17:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 1/1] irqdomain: Fix irq_domain_alloc_irqs_recursive()  error handling Marc Zyngier <marc.zyngier@arm.com> - 2016-07-11 17:20 +0200

#1440703 — Re: [PATCH 1/1] irqdomain: Fix irq_domain_alloc_irqs_recursive() error handling

FromMarc Zyngier <marc.zyngier@arm.com>
Date2016-07-11 17:20 +0200
SubjectRe: [PATCH 1/1] irqdomain: Fix irq_domain_alloc_irqs_recursive() error handling
Message-ID<rTLa2-hv-7@gated-at.bofh.it>
On 03/07/16 01: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.
> 
> Signed-off-by: Alexander Popov <alex.popov@linux.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);
>  
> 

Acked-by: Marc Zyngier <marc.zyngier@arm.com>

	M.
-- 
Jazz is not dead. It just smells funny...

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web