Skip to contentSkip to conversation

iommu/vt-d: signedness bug in alloc_irte()

PATCH Applied Dan Carpenter 2 participants 2 messages Jan 9, 2014 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/vt-d: signedness bug in alloc_irte()

"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')
drivers/iommu/intel_irq_remapping.c +1 -6
index 78fba6212ed2..ef5f65dbafe9 100644
@@ -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);

A message that is not in the archive (sent off-list or not yet received): [email protected]

maintainer Applied
#2 lore raw
Quoted 6 lines · Dan Carpenter

"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')

Applied, thanks Dan.