/* This function must be called with the queue lock held.  */
int uvc_free_buffers(struct uvc_video_queue *queue)
/* This function must be called with the queue lock held.  */
int uvc_free_buffers(struct uvc_video_queue *queue)
{
	unsigned int i;
	for (i = 0; i < queue->count; ++i) {
		if (queue->buffer[i].vma_use_count != 0)
			return -EBUSY;
	}
	if (queue->count) {
		vfree(queue->mem);
		queue->count = 0;
	}
	return 0;
}