libcamera: camera: Don't call freeBuffer() on allocateBuffer() error

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

Perform clean-up on allocations failures in the IPU3 pipeline handler,
now that freeBuffers() is not called anymore.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Jacopo Mondi
2019-04-16 15:31:45 +02:00
parent 911bc4aa41
commit da341a4dd1
2 changed files with 11 additions and 6 deletions

View File

@@ -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;
}