summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2011-11-15 16:25:39 +0900
committerInki Dae <inki.dae@samsung.com>2011-11-17 10:05:39 +0900
commitca22e3cc25f180859561f36d51bf21278db5ae11 (patch)
treec7f480c59af0586198cb4ef58c4b45386fed0bf5 /drivers/gpu
parent396464dfbba8f734c57346489b871e7ed64dcdd1 (diff)
downloadlinux-ca22e3cc25f180859561f36d51bf21278db5ae11.tar.gz
linux-ca22e3cc25f180859561f36d51bf21278db5ae11.tar.bz2
linux-ca22e3cc25f180859561f36d51bf21278db5ae11.zip
drm/exynos: fixed wrong err ptr usage and destroy call in exeception
- exynos_drm_buf_create() returns err pointer so NULL check is wrong. - Case that exynos_gem_obj is not created, destroy call in exception handle lable uses this pointer. so instead buffer is directly used. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_gem.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index b1b94b1e4400..aba0fe47f7ea 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -128,30 +128,25 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev,
struct exynos_drm_gem_obj *exynos_gem_obj = NULL;
struct exynos_drm_gem_buf *buffer;
- int ret;
size = roundup(size, PAGE_SIZE);
DRM_DEBUG_KMS("%s: size = 0x%lx\n", __FILE__, size);
buffer = exynos_drm_buf_create(dev, size);
- if (!buffer)
- return ERR_PTR(-ENOMEM);
+ if (IS_ERR(buffer)) {
+ return ERR_CAST(buffer);
+ }
exynos_gem_obj = exynos_drm_gem_init(dev, file_priv, handle, size);
if (IS_ERR(exynos_gem_obj)) {
- ret = PTR_ERR(exynos_gem_obj);
- goto err_gem_init;
+ exynos_drm_buf_destroy(dev, buffer);
+ return exynos_gem_obj;
}
exynos_gem_obj->buffer = buffer;
return exynos_gem_obj;
-
-err_gem_init:
- exynos_drm_buf_destroy(dev, exynos_gem_obj->buffer);
-
- return ERR_PTR(ret);
}
int exynos_drm_gem_create_ioctl(struct drm_device *dev, void *data,