dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Oleksandr Andrushchenko <andr2000@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: David Airlie <airlied@linux.ie>,
	kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org,
	xen-devel@lists.xen.org
Subject: Re: [PATCH] drm/xen-front: Fix error code in xen_drm_front_gem_get_sg_table()
Date: Thu, 19 Jul 2018 12:06:38 +0300	[thread overview]
Message-ID: <b8154096-3a43-cca1-316e-4d60d69ee9ab@gmail.com> (raw)
In-Reply-To: <20180719081133.k7asay4fl2qhhpjf@mwanda>

Hi, Dan!

Thank you for the patch and sorry I was clumsy sending v3.

Do you want me to send v3 now with the fixes for both Xen and CMA?

Thank you,

Oleksandr


On 07/19/2018 11:11 AM, Dan Carpenter wrote:
> The xen_drm_front_gem_get_sg_table() function is supposed to return
> error pointer.  The current code, would trigger a NULL dereference in
> drm_gem_map_dma_buf().
>
> Fixes: c575b7eeb89f ("drm/xen-front: Add support for Xen PV display frontend")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/gpu/drm/xen/xen_drm_front_gem.c b/drivers/gpu/drm/xen/xen_drm_front_gem.c
> index c85bfe7571cb..4507bc03ed8f 100644
> --- a/drivers/gpu/drm/xen/xen_drm_front_gem.c
> +++ b/drivers/gpu/drm/xen/xen_drm_front_gem.c
> @@ -179,7 +179,7 @@ struct sg_table *xen_drm_front_gem_get_sg_table(struct drm_gem_object *gem_obj)
>   	struct xen_gem_object *xen_obj = to_xen_gem_obj(gem_obj);
>   
>   	if (!xen_obj->pages)
> -		return NULL;
> +		return ERR_PTR(-EINVAL);
>   
>   	return drm_prime_pages_to_sg(xen_obj->pages, xen_obj->num_pages);
>   }

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-07-19  9:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-19  8:11 [PATCH] drm/xen-front: Fix error code in xen_drm_front_gem_get_sg_table() Dan Carpenter
2018-07-19  9:06 ` Oleksandr Andrushchenko [this message]
2018-07-19  9:20   ` Dan Carpenter
2018-07-19  9:25     ` Oleksandr Andrushchenko
2018-07-19  9:20 ` Dan Carpenter

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=b8154096-3a43-cca1-316e-4d60d69ee9ab@gmail.com \
    --to=andr2000@gmail.com \
    --cc=airlied@linux.ie \
    --cc=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=xen-devel@lists.xen.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).