From 38054e2baf09fc45c070fc7978aa1c8225b4bf7d Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Thu, 13 Sep 2018 16:09:04 +0900 Subject: [PATCH] drm/tgm: tdm_pp: fix not to call sync fence without fence/dma_buf When without fence or dma_buf, tdm_pp tries to call sync fence and it causes null deference or not necessary error message. Fix not to call sync fence without fence or dma_buf. Change-Id: Ifb6f460a4bd3470c2a692f8b9b5d526a263f1e68 Signed-off-by: Seung-Woo Kim --- drivers/gpu/drm/tgm/tdm_pp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tgm/tdm_pp.c b/drivers/gpu/drm/tgm/tdm_pp.c index d89af02d559..d6059de096e 100644 --- a/drivers/gpu/drm/tgm/tdm_pp.c +++ b/drivers/gpu/drm/tgm/tdm_pp.c @@ -573,7 +573,7 @@ static int pp_put_mem_node(struct drm_device *drm_dev, #ifdef CONFIG_DRM_DMA_SYNC if (m_node->ops_id == TDM_OPS_SRC) { - if (!IS_ERR(m_node->fence)) + if (!IS_ERR_OR_NULL(m_node->fence)) tdm_fence_signal(drm_dev, m_node->fence); } #endif @@ -879,7 +879,7 @@ static int pp_set_mem_node(struct tdm_ppdrv *ppdrv, dma_buf = tbm_gem_get_dma_buf(ppdrv->drm_dev, ppdrv->dev, m_node->buf_info.handles[0], c_node->filp); - if (!IS_ERR(dma_buf)) + if (!IS_ERR_OR_NULL(dma_buf)) m_node->fence = tdm_fence(ppdrv->drm_dev, dma_buf); } #endif -- 2.34.1