From bfecf4781373b1b1cf111f0a1a60466b102499e0 Mon Sep 17 00:00:00 2001 From: "Shengqin.Zhang" Date: Mon, 25 May 2015 15:30:20 +0800 Subject: [PATCH] fix rga mmu buf cause system crash when use ion mmu buf Signed-off-by: Shengqin.Zhang --- drivers/video/rockchip/rga2/rga2_mmu_info.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/video/rockchip/rga2/rga2_mmu_info.c b/drivers/video/rockchip/rga2/rga2_mmu_info.c index ca05a79d08c1..0d90d539a470 100644 --- a/drivers/video/rockchip/rga2/rga2_mmu_info.c +++ b/drivers/video/rockchip/rga2/rga2_mmu_info.c @@ -358,6 +358,7 @@ static int rga2_MapION(struct sg_table *sg, uint32_t len; struct scatterlist *sgl = sg->sgl; uint32_t sg_num = 0; + uint32_t break_flag = 0; status = 0; Address = 0; @@ -366,9 +367,14 @@ static int rga2_MapION(struct sg_table *sg, Address = sg_phys(sgl); for(i=0; i= pageCount) { + break_flag = 1; + break; + } Memory[mapped_size + i] = (uint32_t)(Address + (i << PAGE_SHIFT)); } - + if (break_flag) + break; mapped_size += len; sg_num += 1; } -- 2.34.1