Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dan Carpenter and committed by
Dave Airlie
2b7edcad dc9be8e2

+2 -2
+2 -2
drivers/gpu/drm/virtio/virtgpu_fb.c
··· 299 299 300 300 size = mode_cmd.pitches[0] * mode_cmd.height; 301 301 obj = virtio_gpu_alloc_object(dev, size, false, true); 302 - if (!obj) 303 - return -ENOMEM; 302 + if (IS_ERR(obj)) 303 + return PTR_ERR(obj); 304 304 305 305 virtio_gpu_resource_id_get(vgdev, &resid); 306 306 virtio_gpu_cmd_create_resource(vgdev, resid, format,