Skip to contentSkip to conversation

iommu/mediatek: signedness bug in probe function

PATCH Applied Dan Carpenter 2 participants 2 messages Mar 2, 2016

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

PATCH 1/2 iommu/mediatek: signedness bug in probe function

"larb_nr" needs to be signed for the error handling to work. "i" can be int as well.

Fixes 0df4fabe208d ('iommu/mediatek: Add mt8173 IOMMU driver')
drivers/iommu/mtk_iommu.c +1 -1
index 721ffdb..1a4022c 100644
@@ -578,7 +578,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)
 	struct resource         *res;
 	struct component_match  *match = NULL;
 	void                    *protect;
-	unsigned int            i, larb_nr;
+	int			i, larb_nr;
 	int                     ret;
 
 	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
maintainer
#1 lore raw
Quoted 11 lines · Dan Carpenter

"larb_nr" needs to be signed for the error handling to work. "i" can be int as well.

Fixes 0df4fabe208d ('iommu/mediatek: Add mt8173 IOMMU driver')
drivers/iommu/mtk_iommu.c +0 -0
index 721ffdb..1a4022c 100644

drivers/iommu/mtk_iommu.c static int mtk_iommu_probe(struct platform_device *pdev) · line 584

Quoted 8 lines
drivers/iommu/mtk_iommu.c +1 -1
@@ -578,7 +578,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)
 	struct resource         *res;
 	struct component_match  *match = NULL;
 	void                    *protect;
-	unsigned int            i, larb_nr;
+	int			i, larb_nr;
 	int                     ret;
 
 	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);

I merged a similar fix from Andrzej Hajda yesterday.