diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-05-08 12:27:39 +0300 |
---|---|---|
committer | Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> | 2018-05-08 14:09:52 +0300 |
commit | 18f20bc5303cf6276cce9ae1742f3835244ad087 (patch) | |
tree | 8f9f98fac6ca1421440f5b76bce86aac59ab54c3 /drivers/gpu/drm/xen/xen_drm_front_shbuf.c | |
parent | e30ca4bcf0d9ad2c6f5716d6098b935f0d584c76 (diff) | |
download | linux-18f20bc5303cf6276cce9ae1742f3835244ad087.tar.xz |
drm/xen-front: fix xen_drm_front_shbuf_alloc() error handling
The xen_drm_front_shbuf_alloc() function was returning a mix of error
pointers and NULL and the the caller wasn't checking correctly. I've
changed it to always return error pointer consistently.
Fixes: c575b7eeb89f ("drm/xen-front: Add support for Xen PV display frontend")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180508092739.GB661@mwanda
Diffstat (limited to 'drivers/gpu/drm/xen/xen_drm_front_shbuf.c')
-rw-r--r-- | drivers/gpu/drm/xen/xen_drm_front_shbuf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xen/xen_drm_front_shbuf.c b/drivers/gpu/drm/xen/xen_drm_front_shbuf.c index d5705251a0d6..8099cb343ae3 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_shbuf.c +++ b/drivers/gpu/drm/xen/xen_drm_front_shbuf.c @@ -383,7 +383,7 @@ xen_drm_front_shbuf_alloc(struct xen_drm_front_shbuf_cfg *cfg) buf = kzalloc(sizeof(*buf), GFP_KERNEL); if (!buf) - return NULL; + return ERR_PTR(-ENOMEM); if (cfg->be_alloc) buf->ops = &backend_ops; |