mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 21:07:02 +09:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user