kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] drm/virtio: checking for NULL instead of IS_ERR
@ 2015-06-10 19:27 Dan Carpenter
  2015-06-11  6:16 ` Gerd Hoffmann
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-06-10 19:27 UTC (permalink / raw)
  To: David Airlie; +Cc: kernel-janitors, dri-devel, virtualization

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>

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,

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] drm/virtio: checking for NULL instead of IS_ERR
  2015-06-10 19:27 [patch] drm/virtio: checking for NULL instead of IS_ERR Dan Carpenter
@ 2015-06-11  6:16 ` Gerd Hoffmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2015-06-11  6:16 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: David Airlie, dri-devel, virtualization, kernel-janitors

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@oracle.com>

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-11  6:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10 19:27 [patch] drm/virtio: checking for NULL instead of IS_ERR Dan Carpenter
2015-06-11  6:16 ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).