[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1010182304050.6815@localhost6.localdomain6>
Date: Mon, 18 Oct 2010 23:09:23 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Yinghai Lu <yinghai@...nel.org>
cc: Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86, irq: Check if irq is remapped before freeing irte
On Mon, 18 Oct 2010, Yinghai Lu wrote:
>
> Index: linux-2.6/drivers/pci/intr_remapping.c
> ===================================================================
> --- linux-2.6.orig/drivers/pci/intr_remapping.c
> +++ linux-2.6/drivers/pci/intr_remapping.c
> @@ -60,7 +60,7 @@ int get_irte(int irq, struct irte *entry
> unsigned long flags;
> int index;
>
> - if (!entry || !irq_iommu)
> + if (!entry || !irq_iommu || !irq_iommu->iommu)
> return -1;
Hmm, why do we need this? This is only called from
ir_ioapic_set_affinity() and ir_msi_set_affinity().
We should never end up there when intr_remapping=off, right ?
> spin_lock_irqsave(&irq_2_ir_lock, flags);
> @@ -268,7 +268,7 @@ int free_irte(int irq)
> unsigned long flags;
> int rc;
>
> - if (!irq_iommu)
> + if (!irq_iommu || !irq_iommu->iommu)
> return -1;
That one makes sense
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists