Dan Carpenter
2015-Jun-10 19:27 UTC
[patch] 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 at oracle.com> diff --git a/drivers/gpu/drm/virtio/virtgpu_fb.c b/drivers/gpu/drm/virtio/virtgpu_fb.c index 25bf333..df198d9 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,
Gerd Hoffmann
2015-Jun-11 06:16 UTC
[patch] drm/virtio: checking for NULL instead of IS_ERR
On Mi, 2015-06-10 at 22:27 +0300, Dan Carpenter wrote:> 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 at oracle.com>Reviewed-by: Gerd Hoffmann <kraxel at redhat.com>
Reasonably Related Threads
- [patch] drm/virtio: checking for NULL instead of IS_ERR
- [PATCH 1/2] drm: virtio: add virtio_gpu_translate_format
- [PATCH 1/2] drm: virtio: add virtio_gpu_translate_format
- [PATCH 1/2] drm: virtio: add virtio_gpu_translate_format
- [PATCH] drm/virtio: switch to generic fbdev emulation