* [PATCH] irq/irqdomain: change bail out condition for irq_domain_add()
@ 2011-09-20 21:36 Sebastian Andrzej Siewior
2011-09-20 21:41 ` Thomas Gleixner
0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2011-09-20 21:36 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: linux-kernel, Sebastian Andrzej Siewior, Grant Likely
I tried to convert x86 to this infrastructure and I run into
|BUG: unable to handle kernel NULL pointer dereference at 00000014
(d || d->domain) is kinda bogus because if d is NULL it will check for
d->domain which should fail. It seems that the code needs the irq_data
to be present and there should be no irq_domain set yet. This patch does
this.
My convert to this infrastructure still does not work with this patch
but I have enough for today.
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/irq/irqdomain.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index d5828da..213089b 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -29,7 +29,7 @@ void irq_domain_add(struct irq_domain *domain)
*/
for (hwirq = 0; hwirq < domain->nr_irq; hwirq++) {
d = irq_get_irq_data(irq_domain_to_irq(domain, hwirq));
- if (d || d->domain) {
+ if (!d || d->domain) {
/* things are broken; just report, don't clean up */
WARN(1, "error: irq_desc already assigned to a domain");
return;
--
1.7.6.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] irq/irqdomain: change bail out condition for irq_domain_add()
2011-09-20 21:36 [PATCH] irq/irqdomain: change bail out condition for irq_domain_add() Sebastian Andrzej Siewior
@ 2011-09-20 21:41 ` Thomas Gleixner
2011-09-20 21:43 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2011-09-20 21:41 UTC (permalink / raw)
To: Sebastian Andrzej Siewior; +Cc: linux-kernel, Grant Likely
On Tue, 20 Sep 2011, Sebastian Andrzej Siewior wrote:
> I tried to convert x86 to this infrastructure and I run into
> |BUG: unable to handle kernel NULL pointer dereference at 00000014
>
> (d || d->domain) is kinda bogus because if d is NULL it will check for
> d->domain which should fail. It seems that the code needs the irq_data
> to be present and there should be no irq_domain set yet. This patch does
> this.
>
> My convert to this infrastructure still does not work with this patch
> but I have enough for today.
>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> kernel/irq/irqdomain.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
> index d5828da..213089b 100644
> --- a/kernel/irq/irqdomain.c
> +++ b/kernel/irq/irqdomain.c
> @@ -29,7 +29,7 @@ void irq_domain_add(struct irq_domain *domain)
> */
> for (hwirq = 0; hwirq < domain->nr_irq; hwirq++) {
> d = irq_get_irq_data(irq_domain_to_irq(domain, hwirq));
> - if (d || d->domain) {
> + if (!d || d->domain) {
> /* things are broken; just report, don't clean up */
> WARN(1, "error: irq_desc already assigned to a domain");
> return;
I've already queued a similar fix in tip/irq/urgent
Thanks,
tglx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] irq/irqdomain: change bail out condition for irq_domain_add()
2011-09-20 21:41 ` Thomas Gleixner
@ 2011-09-20 21:43 ` Sebastian Andrzej Siewior
0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2011-09-20 21:43 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: linux-kernel, Grant Likely
On 09/20/2011 11:41 PM, Thomas Gleixner wrote:
> I've already queued a similar fix in tip/irq/urgent
It is not in master branch of the tip tree.
> Thanks,
>
> tglx
Sebastian
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-09-20 21:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-20 21:36 [PATCH] irq/irqdomain: change bail out condition for irq_domain_add() Sebastian Andrzej Siewior
2011-09-20 21:41 ` Thomas Gleixner
2011-09-20 21:43 ` Sebastian Andrzej Siewior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox