From: Dan Carpenter Date: Wed, 10 Jun 2015 19:27:11 +0000 (+0300) Subject: drm/virtio: checking for NULL instead of IS_ERR X-Git-Tag: firefly_0821_release~176^2~1470^2~22 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2b7edcad69ecf6c452871c80a336bc3430ca9942;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Dave Airlie --- 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,