Skip to content

Commit 90f84e5

Browse files
Yu Qiaoweirkhuangtao
authored andcommitted
video/rockchip: rga2: Fix some errors.
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com> Change-Id: I2bc574f6423da23d44a0b5361e216854636d83a0
1 parent d6f20ff commit 90f84e5

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

drivers/video/rockchip/rga2/rga2_drv.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2036,7 +2036,9 @@ static void RGA2_flush_page(void)
20362036
reg = list_entry(rga2_service.running.prev,
20372037
struct rga2_reg, status_link);
20382038

2039-
if (reg == NULL && reg->MMU_base == NULL)
2039+
if (reg == NULL)
2040+
return;
2041+
if (reg->MMU_base == NULL)
20402042
return;
20412043

20422044
for (i = 0; i < reg->MMU_count; i++)

drivers/video/rockchip/rga2/rga2_mmu_info.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,10 @@ static int rga2_mmu_flush_cache(struct rga2_reg *reg, struct rga2_req *req)
556556
DstPageCount = 0;
557557
DstStart = 0;
558558

559-
if (reg->MMU_map != true)
559+
if (reg->MMU_map != true) {
560+
status = -EINVAL;
560561
goto out;
562+
}
561563

562564
/* cal dst buf mmu info */
563565
if (req->mmu_info.dst_mmu_flag & 1) {
@@ -589,6 +591,7 @@ static int rga2_mmu_flush_cache(struct rga2_reg *reg, struct rga2_req *req)
589591
mutex_unlock(&rga2_service.lock);
590592
if (DstMemSize) {
591593
if (req->sg_dst) {
594+
status = -EINVAL;
592595
goto out;
593596
} else {
594597
ret = rga2_MapUserMemory(&pages[0],
@@ -1128,6 +1131,8 @@ static int rga2_mmu_info_update_patten_buff_mode(struct rga2_reg *reg, struct rg
11281131
pages = rga2_mmu_buf.pages;
11291132

11301133
MMU_Base = kzalloc(AllSize * sizeof(uint32_t), GFP_KERNEL);
1134+
if (MMU_Base == NULL)
1135+
return -EINVAL;
11311136

11321137
for(i=0; i<CMDMemSize; i++) {
11331138
MMU_Base[i] = virt_to_phys((uint32_t *)((CMDStart + i) << PAGE_SHIFT));

0 commit comments

Comments
 (0)