Commit 2b7edcad authored by Dan Carpenter's avatar Dan Carpenter Committed by Dave Airlie

drm/virtio: checking for NULL instead of IS_ERR

virtio_gpu_alloc_object() returns an error pointer, it never returns
NULL.

Fixes: dc5698e8 ('Add virtio gpu driver.')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent dc9be8e2
...@@ -299,8 +299,8 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper, ...@@ -299,8 +299,8 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
size = mode_cmd.pitches[0] * mode_cmd.height; size = mode_cmd.pitches[0] * mode_cmd.height;
obj = virtio_gpu_alloc_object(dev, size, false, true); obj = virtio_gpu_alloc_object(dev, size, false, true);
if (!obj) if (IS_ERR(obj))
return -ENOMEM; return PTR_ERR(obj);
virtio_gpu_resource_id_get(vgdev, &resid); virtio_gpu_resource_id_get(vgdev, &resid);
virtio_gpu_cmd_create_resource(vgdev, resid, format, virtio_gpu_cmd_create_resource(vgdev, resid, format,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment