[libcamera-devel] [PATCH v6 3/7] libcamera: camera: Don't call freeBuffer() on allocateBuffer() error

Jacopo Mondi jacopo at jmondi.org
Tue Apr 16 15:42:06 CEST 2019


Do not assume the freeBuffer() function can handle allocateBuffer()
method failures, as error handling and clean up should be performed
by allocateBuffer() method itself.

Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 src/libcamera/camera.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
index 21caa24b90b5..2d0a80664214 100644
--- a/src/libcamera/camera.cpp
+++ b/src/libcamera/camera.cpp
@@ -650,7 +650,6 @@ int Camera::allocateBuffers()
 	int ret = pipe_->allocateBuffers(this, activeStreams_);
 	if (ret) {
 		LOG(Camera, Error) << "Failed to allocate buffers";
-		freeBuffers();
 		return ret;
 	}
 
-- 
2.21.0



More information about the libcamera-devel mailing list