Commit 5f3f4266 authored by Joonyoung Shim's avatar Joonyoung Shim Committed by Inki Dae

drm/exynos: use ERR_PTR instead of NULL in exynos_drm_gem_init

For more correct error information.
Signed-off-by: default avatarJoonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent 8e38976e
...@@ -139,7 +139,7 @@ struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev, ...@@ -139,7 +139,7 @@ struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev,
exynos_gem_obj = kzalloc(sizeof(*exynos_gem_obj), GFP_KERNEL); exynos_gem_obj = kzalloc(sizeof(*exynos_gem_obj), GFP_KERNEL);
if (!exynos_gem_obj) if (!exynos_gem_obj)
return NULL; return ERR_PTR(-ENOMEM);
exynos_gem_obj->size = size; exynos_gem_obj->size = size;
obj = &exynos_gem_obj->base; obj = &exynos_gem_obj->base;
...@@ -148,7 +148,7 @@ struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev, ...@@ -148,7 +148,7 @@ struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev,
if (ret < 0) { if (ret < 0) {
DRM_ERROR("failed to initialize gem object\n"); DRM_ERROR("failed to initialize gem object\n");
kfree(exynos_gem_obj); kfree(exynos_gem_obj);
return NULL; return ERR_PTR(ret);
} }
DRM_DEBUG_KMS("created file object = 0x%x\n", (unsigned int)obj->filp); DRM_DEBUG_KMS("created file object = 0x%x\n", (unsigned int)obj->filp);
...@@ -180,8 +180,8 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev, ...@@ -180,8 +180,8 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev,
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
exynos_gem_obj = exynos_drm_gem_init(dev, size); exynos_gem_obj = exynos_drm_gem_init(dev, size);
if (!exynos_gem_obj) { if (IS_ERR(exynos_gem_obj)) {
ret = -ENOMEM; ret = PTR_ERR(exynos_gem_obj);
goto err_fini_buf; goto err_fini_buf;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment