From a775234d6612a1fbd3bb586de4704883c1fcd817 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 12 Jul 2019 21:13:57 +0300 Subject: libcamera: camera: Don't check buffer count before freeing buffers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's no need to check if buffers have been allocated before freeing them as the BufferPool::destroyBuffers() method is a no-op when no buffers have been allocated. Document this fact explicitly, and remove the buffer count check. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/libcamera/camera.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/libcamera/camera.cpp') diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp index 094f1b63..810cb129 100644 --- a/src/libcamera/camera.cpp +++ b/src/libcamera/camera.cpp @@ -740,9 +740,6 @@ int Camera::freeBuffers() return -EACCES; for (Stream *stream : activeStreams_) { - if (!stream->bufferPool().count()) - continue; - /* * All mappings must be destroyed before buffers can be freed * by the V4L2 device that has allocated them. -- cgit v1.2.1