diff mbox

drm/exynos: fix error return code in exynos_drm_load()

Message ID CAPgLHd9K0+A5dOOT2bj+fB1owkECMpSGBaqrq-Zs6b-t_G-_7A@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun May 7, 2013, 1:43 p.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return -ENOMEM in the exynos_plane_init() error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

대인기/Tizen Platform Lab(SR)/삼성전자 May 12, 2013, 7:25 a.m. UTC | #1
2013/5/7 Wei Yongjun <weiyj.lk@gmail.com>

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Fix to return -ENOMEM in the exynos_plane_init() error handling
> case instead of 0, as done elsewhere in this function.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> index ba6d995..3a10373 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> @@ -91,8 +91,10 @@ static int exynos_drm_load(struct drm_device *dev,
> unsigned long flags)
>                 unsigned int possible_crtcs = (1 << MAX_CRTC) - 1;
>
>                 plane = exynos_plane_init(dev, possible_crtcs, false);
> -               if (!plane)
> +               if (!plane) {
> +                       ret = -ENOMEM;
>

I think It's better that exynos_plane_init function returns ERR_PTR(error)
instead of NULL and ret = PTR_ERR(plane) if IS_ERR(plane) so could you
resend updated patch again?

Thanks,
Inki Dae



>                         goto err_release_iommu_mapping;
> +               }
>         }
>
>         ret = drm_vblank_init(dev, MAX_CRTC);
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index ba6d995..3a10373 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -91,8 +91,10 @@  static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
 		unsigned int possible_crtcs = (1 << MAX_CRTC) - 1;
 
 		plane = exynos_plane_init(dev, possible_crtcs, false);
-		if (!plane)
+		if (!plane) {
+			ret = -ENOMEM;
 			goto err_release_iommu_mapping;
+		}
 	}
 
 	ret = drm_vblank_init(dev, MAX_CRTC);