From: Marc Zyngier <maz@kernel.org>
To: Adam Lackorzynski <adam@l4re.org>
Cc: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] irqchip/bcm2836: Fix return check in IPI alloc
Date: Tue, 29 Dec 2020 09:31:34 +0000 [thread overview]
Message-ID: <2e4ccdb4065a5d9a3228344bffcaece9@kernel.org> (raw)
In-Reply-To: <20201228223014.3253924-1-adam@l4re.org>
On 2020-12-28 22:30, Adam Lackorzynski wrote:
> __irq_domain_alloc_irqs returns a negative error
> code upon failure, not only 0. Also use irq_domain_alloc_irqs
> to require less default arguments.
>
> Signed-off-by: Adam Lackorzynski <adam@l4re.org>
> ---
> drivers/irqchip/irq-bcm2836.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/irqchip/irq-bcm2836.c
> b/drivers/irqchip/irq-bcm2836.c
> index 5f5eb8877c41..853fd420ab2b 100644
> --- a/drivers/irqchip/irq-bcm2836.c
> +++ b/drivers/irqchip/irq-bcm2836.c
> @@ -268,11 +268,10 @@ static void __init
> bcm2836_arm_irqchip_smp_init(void)
> ipi_domain->flags |= IRQ_DOMAIN_FLAG_IPI_SINGLE;
> irq_domain_update_bus_token(ipi_domain, DOMAIN_BUS_IPI);
>
> - base_ipi = __irq_domain_alloc_irqs(ipi_domain, -1, BITS_PER_MBOX,
> - NUMA_NO_NODE, NULL,
> - false, NULL);
> + base_ipi = irq_domain_alloc_irqs(ipi_domain, BITS_PER_MBOX,
> + NUMA_NO_NODE, NULL);
>
> - if (WARN_ON(!base_ipi))
> + if (WARN_ON(base_ipi < 0))
This is wrong. 0 isn't a valid IRQ number, and should be rejected.
M.
--
Jazz is not dead. It just smells funny...
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-12-29 9:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-28 22:30 [PATCH] irqchip/bcm2836: Fix return check in IPI alloc Adam Lackorzynski
2020-12-29 9:31 ` Marc Zyngier [this message]
2020-12-29 23:16 ` Adam Lackorzynski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2e4ccdb4065a5d9a3228344bffcaece9@kernel.org \
--to=maz@kernel.org \
--cc=adam@l4re.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).