diff options
author | YoungJun Cho <yj44.cho@samsung.com> | 2013-07-01 11:17:12 +0900 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2013-07-04 15:55:36 +0900 |
commit | c58c1599cd5c97977c44047272b56b4db455bbba (patch) | |
tree | 3f99572ec87b0ffe5fc246709026565c47558629 /drivers/gpu/drm/exynos/exynos_drm_gem.c | |
parent | 8eed2641df55f7a3e69699b50a63f5705533886f (diff) | |
download | talos-obmc-linux-c58c1599cd5c97977c44047272b56b4db455bbba.tar.gz talos-obmc-linux-c58c1599cd5c97977c44047272b56b4db455bbba.zip |
drm/exynos: fix not to remain exynos_gem_obj as a leak
The exynos_drm_gem_create() only calls drm_gem_object_release()
when exynos_drm_alloc_buf() is failed, and exynos_gem_obj remains
as a leak, which is allocated in exynos_drm_gem_init().
So this patch fixes it not to remain as a leak.
Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_gem.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gem.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index c3f15e7646d5..24c22a8c3364 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -246,13 +246,14 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev, exynos_gem_obj->flags = flags; ret = exynos_drm_alloc_buf(dev, buf, flags); - if (ret < 0) { - drm_gem_object_release(&exynos_gem_obj->base); - goto err_fini_buf; - } + if (ret < 0) + goto err_gem_fini; return exynos_gem_obj; +err_gem_fini: + drm_gem_object_release(&exynos_gem_obj->base); + kfree(exynos_gem_obj); err_fini_buf: exynos_drm_fini_buf(dev, buf); return ERR_PTR(ret); |