Add virtio gpu driver.

Dan Carpenter dan.carpenter at oracle.com
Wed Jun 24 07:29:08 PDT 2015


Hello Dave Airlie,

The patch dc5698e80cf7: "Add virtio gpu driver." from Sep 9, 2013,
leads to the following static checker warning:

	drivers/gpu/drm/virtio/virtgpu_vq.c:119 virtio_gpu_free_vbufs()
	warn: inconsistent returns 'spin_lock:&vgdev->free_vbufs_lock'.

drivers/gpu/drm/virtio/virtgpu_vq.c
   102  void virtio_gpu_free_vbufs(struct virtio_gpu_device *vgdev)
   103  {
   104          struct virtio_gpu_vbuffer *vbuf;
   105          int i, count = 0;
   106  
   107          count += virtqueue_get_vring_size(vgdev->ctrlq.vq);
   108          count += virtqueue_get_vring_size(vgdev->cursorq.vq);
   109  
   110          spin_lock(&vgdev->free_vbufs_lock);
   111          for (i = 0; i < count; i++) {
   112                  if (WARN_ON(list_empty(&vgdev->free_vbufs)))
   113                          return;
                                ^^^^^^^
Returning with lock held.

   114                  vbuf = list_first_entry(&vgdev->free_vbufs,
   115                                          struct virtio_gpu_vbuffer, list);
   116                  list_del(&vbuf->list);
   117          }
   118          spin_unlock(&vgdev->free_vbufs_lock);
   119          kfree(vgdev->vbufs);
   120  }

regards,
dan carpenter


More information about the dri-devel mailing list