All of lore.kernel.org
 help / color / mirror / Atom feed
From: Inki Dae <inki.dae@samsung.com>
To: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	DRI mailing list <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/exynos: fix exynos_drm_gem_prime_import_sg_table() error handling
Date: Mon, 31 Aug 2015 01:10:15 +0900	[thread overview]
Message-ID: <CAAQKjZO=wpe19ayL6iULn263pWPH2KgXQePxfLZ2HdHeh-sb5Q@mail.gmail.com> (raw)
In-Reply-To: <1440664265-20641-1-git-send-email-jy0922.shim@samsung.com>

2015-08-27 17:31 GMT+09:00 Joonyoung Shim <jy0922.shim@samsung.com>:
> 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@oracle.com>
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
> ---
>  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@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-08-30 16:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27  8:31 [PATCH] drm/exynos: fix exynos_drm_gem_prime_import_sg_table() error handling Joonyoung Shim
2015-08-30 16:10 ` Inki Dae [this message]
2015-09-01  6:11   ` Joonyoung Shim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAQKjZO=wpe19ayL6iULn263pWPH2KgXQePxfLZ2HdHeh-sb5Q@mail.gmail.com' \
    --to=inki.dae@samsung.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jy0922.shim@samsung.com \
    --cc=sw0312.kim@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.