diff options
author | Joonyoung Shim <jy0922.shim@samsung.com> | 2015-07-28 08:53:22 (GMT) |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2015-08-16 04:35:13 (GMT) |
commit | 5f3f42664fafa7dd88aee30a2ea77ca45c9362e7 (patch) | |
tree | 9e253e06b02596885b6d967d4c54e6e11d255190 /drivers/gpu/drm/exynos | |
parent | 8e38976ee9aceec4231e7aa5aacf3c6e7aa41471 (diff) | |
download | linux-5f3f42664fafa7dd88aee30a2ea77ca45c9362e7.tar.xz |
drm/exynos: use ERR_PTR instead of NULL in exynos_drm_gem_init
For more correct error information.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gem.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index fa04b9a..d7a687b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -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); if (!exynos_gem_obj) - return NULL; + return ERR_PTR(-ENOMEM); exynos_gem_obj->size = size; obj = &exynos_gem_obj->base; @@ -148,7 +148,7 @@ struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev, if (ret < 0) { DRM_ERROR("failed to initialize gem object\n"); kfree(exynos_gem_obj); - return NULL; + return ERR_PTR(ret); } 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, return ERR_PTR(-ENOMEM); exynos_gem_obj = exynos_drm_gem_init(dev, size); - if (!exynos_gem_obj) { - ret = -ENOMEM; + if (IS_ERR(exynos_gem_obj)) { + ret = PTR_ERR(exynos_gem_obj); goto err_fini_buf; } |