This is a note to let you know that I've just added the patch titled iommu/mediatek: Fix forever loop in error handling to the 6.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: iommu-mediatek-fix-forever-loop-in-error-handling.patch and it can be found in the queue-6.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 936cfd0d5dcf6eafd5741c8b399607e6fac379ff Author: Dan Carpenter <error27@xxxxxxxxx> Date: Wed Dec 7 18:56:09 2022 +0300 iommu/mediatek: Fix forever loop in error handling [ Upstream commit 462e768b55a2331324ff72e74706261134369826 ] There is a typo so this loop does i++ where i-- was intended. It will result in looping until the kernel crashes. Fixes: 26593928564c ("iommu/mediatek: Add error path for loop of mm_dts_parse") Signed-off-by: Dan Carpenter <error27@xxxxxxxxx> Reviewed-by: Yong Wu <yong.wu@xxxxxxxxxxxx> Link: https://lore.kernel.org/r/Y5C3mTam2nkbaz6o@kili Signed-off-by: Joerg Roedel <jroedel@xxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 213fc8f5b6c1..ec73720e239b 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -1127,8 +1127,7 @@ static int mtk_iommu_mm_dts_parse(struct device *dev, struct component_match **m return 0; err_larbdev_put: - /* id may be not linear mapping, loop whole the array */ - for (i = MTK_LARB_NR_MAX - 1; i >= 0; i++) { + for (i = MTK_LARB_NR_MAX - 1; i >= 0; i--) { if (!data->larb_imu[i].dev) continue; put_device(data->larb_imu[i].dev);