[libcamera-devel] [PATCH 1/3] test: list-camera: Handle error on starting the CameraManager

Umang Jain email at uajain.com
Tue Apr 14 09:06:57 CEST 2020


Pointed out by Coverity DefectId=297074

Signed-off-by: Umang Jain <email at uajain.com>
---
 test/list-cameras.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/test/list-cameras.cpp b/test/list-cameras.cpp
index 55551d7..e6a407a 100644
--- a/test/list-cameras.cpp
+++ b/test/list-cameras.cpp
@@ -21,7 +21,10 @@ protected:
 	int init()
 	{
 		cm_ = new CameraManager();
-		cm_->start();
+		if (cm_->start()) {
+			std::cout << "Failed to start camera" << std::endl;
+			return TestFail;
+		}
 
 		return 0;
 	}
-- 
2.26.0



More information about the libcamera-devel mailing list