Skip to content

Commit 462e768

Browse files
error27joergroedel
authored andcommitted
iommu/mediatek: Fix forever loop in error handling
There is a typo so this loop does i++ where i-- was intended. It will result in looping until the kernel crashes. Fixes: 2659392 ("iommu/mediatek: Add error path for loop of mm_dts_parse") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Yong Wu <[email protected]> Link: https://lore.kernel.org/r/Y5C3mTam2nkbaz6o@kili Signed-off-by: Joerg Roedel <[email protected]>
1 parent 00ef888 commit 462e768

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/iommu/mtk_iommu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,8 +1159,7 @@ static int mtk_iommu_mm_dts_parse(struct device *dev, struct component_match **m
11591159
return 0;
11601160

11611161
err_larbdev_put:
1162-
/* id may be not linear mapping, loop whole the array */
1163-
for (i = MTK_LARB_NR_MAX - 1; i >= 0; i++) {
1162+
for (i = MTK_LARB_NR_MAX - 1; i >= 0; i--) {
11641163
if (!data->larb_imu[i].dev)
11651164
continue;
11661165
put_device(data->larb_imu[i].dev);

0 commit comments

Comments
 (0)