vmh264: fixed crash bug.when no virt addr.

PD#172483: if reserved mem is not maped;
	must check the memory before used.

Change-Id: Ie6955059c73858e071c6d3b13e0698d659e6891a
Signed-off-by: Zhi Zhou <zhi.zhou@amlogic.com>
This commit is contained in:
Zhi Zhou
2018-09-21 19:05:00 +08:00
committed by Dongjin Kim
parent 24e759113f
commit 7a7cb8c898

View File

@@ -7318,10 +7318,12 @@ static int ammvdec_h264_probe(struct platform_device *pdev)
#if 1
/*init internal buf*/
tmpbuf = (char *)codec_mm_phys_to_virt(hw->cma_alloc_addr);
memset(tmpbuf, 0, V_BUF_ADDR_OFFSET);
dma_sync_single_for_device(amports_get_dma_device(),
hw->cma_alloc_addr,
V_BUF_ADDR_OFFSET, DMA_TO_DEVICE);
if (tmpbuf) {
memset(tmpbuf, 0, V_BUF_ADDR_OFFSET);
dma_sync_single_for_device(amports_get_dma_device(),
hw->cma_alloc_addr,
V_BUF_ADDR_OFFSET, DMA_TO_DEVICE);
}
#else
/*init sps/pps internal buf 64k*/
tmpbuf = (char *)codec_mm_phys_to_virt(hw->cma_alloc_addr