diff mbox series

drm/mediatek: Drop unbalanced obj unref

Message ID 20230119231255.2883365-1-robdclark@gmail.com (mailing list archive)
State New, archived
Headers show
Series drm/mediatek: Drop unbalanced obj unref | expand

Commit Message

Rob Clark Jan. 19, 2023, 11:12 p.m. UTC
From: Rob Clark <robdclark@chromium.org>

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>
---
 drivers/gpu/drm/mediatek/mtk_drm_gem.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Chun-Kuang Hu Jan. 27, 2023, 3:18 a.m. UTC | #1
Hi, Rob:

Rob Clark <robdclark@gmail.com> 於 2023年1月20日 週五 上午7:12寫道:
>
> From: Rob Clark <robdclark@chromium.org>
>
> In the error path, mtk_drm_gem_object_mmap() is dropping an obj
> reference that it doesn't own.

Applied to mediatek-drm-next [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next

Regards,
Chun-Kuang.

>
> Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.")
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_gem.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
> index 9b3d15d3a983..f961c7c7456b 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
> @@ -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;
>  }
> --
> 2.38.1
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
index 9b3d15d3a983..f961c7c7456b 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
@@ -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;
 }