From d76b10e54238991e4f671bc6a19b30461428ce8f Mon Sep 17 00:00:00 2001 From: Zhaowei Yuan Date: Thu, 17 Jul 2014 20:01:37 +0800 Subject: [PATCH] media: s5p_mfc: Check the right pointer after allocation It should be bank2_virt to be checked after dma allocation instead of dev->fw_virt_addr. Change-Id: I03ed5603de3ef1d97bf76d7d42097d9489b6b003 Signed-off-by: Zhaowei Yuan --- drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c index a428a97..0e1830e 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c @@ -50,7 +50,7 @@ int s5p_mfc_alloc_firmware(struct s5p_mfc_dev *dev) bank2_virt = dma_alloc_coherent(dev->mem_dev_r, 1 << MFC_BASE_ALIGN_ORDER, &bank2_dma_addr, GFP_KERNEL); - if (IS_ERR(dev->fw_virt_addr)) { + if (IS_ERR(bank2_virt)) { mfc_err("Allocating bank2 base failed\n"); dma_free_coherent(dev->mem_dev_l, dev->fw_size, dev->fw_virt_addr, dev->bank1); -- 2.7.4