libcamera: pipelines: ipu3: Simplify error bail out path on start()
On the bail out path, always ensure that ImgU and CIO2 are stopped before freeing the buffers. V4L2VideoDevice class guarantees that calling stop() without having to call start() is harmless, hence use this guarantee to simplify error paths. Signed-off-by: Umang Jain <email@uajain.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
committed by
Kieran Bingham
parent
c0bad607ce
commit
44058f1c68
@@ -617,15 +617,14 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] ControlList *con
|
||||
goto error;
|
||||
|
||||
ret = imgu->start();
|
||||
if (ret) {
|
||||
imgu->stop();
|
||||
cio2->stop();
|
||||
if (ret)
|
||||
goto error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
imgu->stop();
|
||||
cio2->stop();
|
||||
freeBuffers(camera);
|
||||
LOG(IPU3, Error) << "Failed to start camera " << camera->id();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user