Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1600286 > unrolled thread

[PATCH] drm: virtio: fix eno.cocci warnings

Started bykbuild test robot <fengguang.wu@intel.com>
First post2017-03-14 13:30 +0100
Last post2017-03-14 15:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] drm: virtio: fix eno.cocci warnings kbuild test robot <fengguang.wu@intel.com> - 2017-03-14 13:30 +0100
    Re: [PATCH] drm: virtio: fix eno.cocci warnings Gerd Hoffmann <kraxel@redhat.com> - 2017-03-14 15:10 +0100

#1600286 — [PATCH] drm: virtio: fix eno.cocci warnings

Fromkbuild test robot <fengguang.wu@intel.com>
Date2017-03-14 13:30 +0100
Subject[PATCH] drm: virtio: fix eno.cocci warnings
Message-ID<tkTKq-8tD-7@gated-at.bofh.it>
drivers/gpu/drm/virtio/virtgpu_vq.c:100:5-11: ERROR: allocation function on line 99 returns NULL not ERR_PTR on failure

 The various basic memory allocation functions don't return ERR_PTR

Generated by: scripts/coccinelle/null/eno.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 virtgpu_vq.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpu/drm/virtio/virtgpu_vq.c
+++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
@@ -97,7 +97,7 @@ virtio_gpu_get_vbuf(struct virtio_gpu_de
 	struct virtio_gpu_vbuffer *vbuf;
 
 	vbuf = kmem_cache_alloc(vgdev->vbufs, GFP_KERNEL);
-	if (IS_ERR(vbuf))
+	if (!vbuf)
 		return ERR_CAST(vbuf);
 	memset(vbuf, 0, VBUFFER_SIZE);
 

[toc] | [next] | [standalone]


#1600456

FromGerd Hoffmann <kraxel@redhat.com>
Date2017-03-14 15:10 +0100
Message-ID<tkVjc-1eJ-43@gated-at.bofh.it>
In reply to#1600286
  Hi,

>  	vbuf = kmem_cache_alloc(vgdev->vbufs, GFP_KERNEL);
> -	if (IS_ERR(vbuf))
> +	if (!vbuf)
>  		return ERR_CAST(vbuf);

Well, ERR_CAST(vbuf) isn't correct either ...

correct fix has been committed to drm-misc-next today and should show up
in linux-next shortly.

cheers,
  Gerd

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web