]> Git Repo - linux.git/commitdiff
irq: Fix check for already initialized irq_domain in irq_domain_add
authorRob Herring <[email protected]>
Wed, 14 Sep 2011 16:31:37 +0000 (11:31 -0500)
committerThomas Gleixner <[email protected]>
Tue, 20 Sep 2011 10:16:22 +0000 (12:16 +0200)
The sanity check in irq_domain_add() tests desc->irq_data != NULL or
irq_data->domain != NULL. This prevents adding an irq_domain to a irq
descriptor when irq_data exists, which true when the irq descriptor
exists.

This went unnoticed so far as the simple domain code did not enter
this code path because domain->nr_irqs is always 0 for the simple domains.

Split the check for irq_data == NULL out and have a separate warning
for it.

[ tglx: Made the check for irq_data == NULL separate ]

Signed-off-by: Rob Herring <[email protected]>
Cc: Grant Likely <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
kernel/irq/irqdomain.c

index d5828da3fd383908c142971a0b5a91c10be17f71..b57a3776de44dd833eb9a545dced819d69e5fa51 100644 (file)
@@ -29,7 +29,11 @@ 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) {
+                       WARN(1, "error: assigning domain to non existant irq_desc");
+                       return;
+               }
+               if (d->domain) {
                        /* things are broken; just report, don't clean up */
                        WARN(1, "error: irq_desc already assigned to a domain");
                        return;
This page took 0.055412 seconds and 4 git commands to generate.