]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
iommu/vt-d: Fix signedness bug in alloc_irte()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 9 Jan 2014 05:32:36 +0000 (08:32 +0300)
committerJoerg Roedel <joro@8bytes.org>
Thu, 9 Jan 2014 12:05:45 +0000 (13:05 +0100)
"index" needs to be signed for the error handling to work.  I deleted a
little bit of obsolete cruft related to "index" and "start_index" as
well.

Fixes: 360eb3c5687e ('iommu/vt-d: use dedicated bitmap to track remapping entry allocation status')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
drivers/iommu/intel_irq_remapping.c

index f307a3fb93ce683bf555d6c4a166e5bac02ce5ed..b30b423c5aca7f3675a55f637fd1d41f4799e5e5 100644 (file)
@@ -71,18 +71,13 @@ static int alloc_irte(struct intel_iommu *iommu, int irq, u16 count)
        struct ir_table *table = iommu->ir_table;
        struct irq_2_iommu *irq_iommu = irq_2_iommu(irq);
        struct irq_cfg *cfg = irq_get_chip_data(irq);
-       u16 index, start_index;
        unsigned int mask = 0;
        unsigned long flags;
+       int index;
 
        if (!count || !irq_iommu)
                return -1;
 
-       /*
-        * start the IRTE search from index 0.
-        */
-       index = start_index = 0;
-
        if (count > 1) {
                count = __roundup_pow_of_two(count);
                mask = ilog2(count);