提交 f9d8a129 编写于 作者: J Joonyoung Shim 提交者: Dave Airlie

drm/prime: fix sgt NULL checking

The drm_gem_map_detach() can be called with sgt is NULL.
Signed-off-by: NJoonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 63eef600
......@@ -119,12 +119,13 @@ static void drm_gem_map_detach(struct dma_buf *dma_buf,
return;
sgt = prime_attach->sgt;
if (sgt) {
if (prime_attach->dir != DMA_NONE)
dma_unmap_sg(attach->dev, sgt->sgl, sgt->nents,
prime_attach->dir);
sg_free_table(sgt);
}
if (prime_attach->dir != DMA_NONE)
dma_unmap_sg(attach->dev, sgt->sgl, sgt->nents,
prime_attach->dir);
sg_free_table(sgt);
kfree(sgt);
kfree(prime_attach);
attach->priv = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册