summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/virtio
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-06-10 22:27:11 +0300
committerDave Airlie <airlied@redhat.com>2015-06-11 13:16:29 +1000
commit2b7edcad69ecf6c452871c80a336bc3430ca9942 (patch)
tree811d0575913f6352d7a545d88004410b4c11008c /drivers/gpu/drm/virtio
parentdc9be8e2175e5e6e53456d8d52eac9b1dd7ec2a7 (diff)
downloadtalos-obmc-linux-2b7edcad69ecf6c452871c80a336bc3430ca9942.tar.gz
talos-obmc-linux-2b7edcad69ecf6c452871c80a336bc3430ca9942.zip
drm/virtio: checking for NULL instead of IS_ERR
virtio_gpu_alloc_object() returns an error pointer, it never returns NULL. Fixes: dc5698e80cf7 ('Add virtio gpu driver.') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio')
-rw-r--r--drivers/gpu/drm/virtio/virtgpu_fb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_fb.c b/drivers/gpu/drm/virtio/virtgpu_fb.c
index 25bf333d5a45..df198d9e770c 100644
--- a/drivers/gpu/drm/virtio/virtgpu_fb.c
+++ b/drivers/gpu/drm/virtio/virtgpu_fb.c
@@ -299,8 +299,8 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
size = mode_cmd.pitches[0] * mode_cmd.height;
obj = virtio_gpu_alloc_object(dev, size, false, true);
- if (!obj)
- return -ENOMEM;
+ if (IS_ERR(obj))
+ return PTR_ERR(obj);
virtio_gpu_resource_id_get(vgdev, &resid);
virtio_gpu_cmd_create_resource(vgdev, resid, format,
OpenPOWER on IntegriCloud