diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-01-09 00:32:36 -0500 |
---|---|---|
committer | Joerg Roedel <joro@8bytes.org> | 2014-01-09 07:05:45 -0500 |
commit | 9f4c7448f46b881119998702530676b3400752a9 (patch) | |
tree | 5ba0df189db07307763a24c6126972ddab6695fb /drivers/iommu/intel_irq_remapping.c | |
parent | 9bdc531ec63bf894c5e3b7b5a766ce342eb2f52e (diff) |
iommu/vt-d: Fix 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')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu/intel_irq_remapping.c')
-rw-r--r-- | drivers/iommu/intel_irq_remapping.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c index f307a3fb93ce..b30b423c5aca 100644 --- a/drivers/iommu/intel_irq_remapping.c +++ b/drivers/iommu/intel_irq_remapping.c | |||
@@ -71,18 +71,13 @@ static int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) | |||
71 | struct ir_table *table = iommu->ir_table; | 71 | struct ir_table *table = iommu->ir_table; |
72 | struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); | 72 | struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); |
73 | struct irq_cfg *cfg = irq_get_chip_data(irq); | 73 | struct irq_cfg *cfg = irq_get_chip_data(irq); |
74 | u16 index, start_index; | ||
75 | unsigned int mask = 0; | 74 | unsigned int mask = 0; |
76 | unsigned long flags; | 75 | unsigned long flags; |
76 | int index; | ||
77 | 77 | ||
78 | if (!count || !irq_iommu) | 78 | if (!count || !irq_iommu) |
79 | return -1; | 79 | return -1; |
80 | 80 | ||
81 | /* | ||
82 | * start the IRTE search from index 0. | ||
83 | */ | ||
84 | index = start_index = 0; | ||
85 | |||
86 | if (count > 1) { | 81 | if (count > 1) { |
87 | count = __roundup_pow_of_two(count); | 82 | count = __roundup_pow_of_two(count); |
88 | mask = ilog2(count); | 83 | mask = ilog2(count); |