drm/mediatek: Drop unbalanced obj unref
authorRob Clark <robdclark@chromium.org>
Thu, 19 Jan 2023 23:12:55 +0000 (15:12 -0800)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Fri, 27 Jan 2023 03:14:23 +0000 (03:14 +0000)
In the error path, mtk_drm_gem_object_mmap() is dropping an obj
reference that it doesn't own.

Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230119231255.2883365-1-robdclark@gmail.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_drm_gem.c

index 3057790d92642a308219f83d852e5316fec713be..ec0518aa931528451284777fc777fd4f8adf0d79 100644 (file)
@@ -169,8 +169,6 @@ static int mtk_drm_gem_object_mmap(struct drm_gem_object *obj,
 
        ret = dma_mmap_attrs(priv->dma_dev, vma, mtk_gem->cookie,
                             mtk_gem->dma_addr, obj->size, mtk_gem->dma_attrs);
-       if (ret)
-               drm_gem_vm_close(vma);
 
        return ret;
 }