projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8a1a382
)
iommu/mediatek: Fix forever loop in error handling
author
Dan Carpenter
<error27@gmail.com>
Wed, 7 Dec 2022 15:56:09 +0000
(18:56 +0300)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:53 +0000
(13:32 +0100)
[ 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@gmail.com>
Reviewed-by: Yong Wu <yong.wu@mediatek.com>
Link:
https://lore.kernel.org/r/Y5C3mTam2nkbaz6o@kili
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/mtk_iommu.c
patch
|
blob
|
history
diff --git
a/drivers/iommu/mtk_iommu.c
b/drivers/iommu/mtk_iommu.c
index
f154719
..
dad2f23
100644
(file)
--- a/
drivers/iommu/mtk_iommu.c
+++ b/
drivers/iommu/mtk_iommu.c
@@
-1130,8
+1130,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);