From: Dan Carpenter <dan.carpenter@oracle.com>
To: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: David Airlie <airlied@linux.ie>,
kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org,
xen-devel@lists.xen.org
Subject: [PATCH] drm/xen-front: Fix error code in xen_drm_front_gem_get_sg_table()
Date: Thu, 19 Jul 2018 08:11:33 +0000 [thread overview]
Message-ID: <20180719081133.k7asay4fl2qhhpjf@mwanda> (raw)
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);
}
next reply other threads:[~2018-07-19 8:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-19 8:11 Dan Carpenter [this message]
2018-07-19 9:06 ` [PATCH] drm/xen-front: Fix error code in xen_drm_front_gem_get_sg_table() Oleksandr Andrushchenko
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=20180719081133.k7asay4fl2qhhpjf@mwanda \
--to=dan.carpenter@oracle.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=oleksandr_andrushchenko@epam.com \
--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