diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-05-08 12:26:50 +0300 |
---|---|---|
committer | Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> | 2018-05-08 14:09:40 +0300 |
commit | e30ca4bcf0d9ad2c6f5716d6098b935f0d584c76 (patch) | |
tree | aad97bd186c6938581e56d01e323b9649ebfc8eb /drivers/gpu/drm/xen | |
parent | 28eff78618c67277ffe3a6eb4557ad918fd09fe5 (diff) |
drm/xen-front: checking for NULL instead of IS_ERR
drm_dev_alloc() returns error pointers, it never returns NULL.
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/20180508092650.GA661@mwanda
Diffstat (limited to 'drivers/gpu/drm/xen')
-rw-r--r-- | drivers/gpu/drm/xen/xen_drm_front.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/drivers/gpu/drm/xen/xen_drm_front.c index 1b0ea9ac330e..8615e8522c7a 100644 --- a/drivers/gpu/drm/xen/xen_drm_front.c +++ b/drivers/gpu/drm/xen/xen_drm_front.c @@ -543,8 +543,8 @@ static int xen_drm_drv_init(struct xen_drm_front_info *front_info) front_info->drm_info = drm_info; drm_dev = drm_dev_alloc(&xen_drm_driver, dev); - if (!drm_dev) { - ret = -ENOMEM; + if (IS_ERR(drm_dev)) { + ret = PTR_ERR(drm_dev); goto fail; } |