Re: [PATCH] drm/exynos: fix exynos_drm_gem_prime_import_sg_table() error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2015-08-27 17:31 GMT+09:00 Joonyoung Shim <jy0922.shim@xxxxxxxxxxx>:
> If exynos_drm_gem_init() is failed, the result is ERR_PTR, so we should
> just return the result. If not, wrong porinter will be referenced from
> err label.
>
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Signed-off-by: Joonyoung Shim <jy0922.shim@xxxxxxxxxxx>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_gem.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
> index 3e4a64a..4842a31 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
> @@ -569,10 +569,8 @@ exynos_drm_gem_prime_import_sg_table(struct drm_device *dev,
>         int ret;
>
>         exynos_gem_obj = exynos_drm_gem_init(dev, attach->dmabuf->size);
> -       if (IS_ERR(exynos_gem_obj)) {
> -               ret = PTR_ERR(exynos_gem_obj);
> -               goto err;
> -       }
> +       if (IS_ERR(exynos_gem_obj))
> +               return exynos_gem_obj;

This patch incurs below build warning,

drivers/gpu/drm/exynos/exynos_drm_gem.c: In function
'exynos_drm_gem_prime_import_sg_table':
drivers/gpu/drm/exynos/exynos_drm_gem.c:670:3: warning: return from
incompatible pointer type [enabled by default]

We can simply return ERR_PTR(ret) and I just fixed it.

>
>         exynos_gem_obj->dma_addr = sg_dma_address(sgt->sgl);
>
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux