diff options
author | Daniel Scally <dan.scally@ideasonboard.com> | 2025-01-21 13:00:37 +0000 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2025-06-01 22:53:47 +0100 |
commit | e342f050c283283eec1191c94a692325362c170e (patch) | |
tree | 159596c6708d3d7230f7f741ab45603ef770e085 | |
parent | fabee6055f21d0f47915e0d03c112fce3c2172b2 (diff) |
libcamera: mali-c55: Fix error paths in ::init()
In the MaliC55CameraData::init() function there are two places that
return values they shouldn't; the ret variable is returned after
checking a pointer is not null instead of an explicit -ENODEV and later
the boolean value false is returned on failure instead of the error
value returned by V4L2Subdevice::open() - fix both problems.
Signed-off-by: Daniel Scally <dan.scally@ideasonboard.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>
-rw-r--r-- | src/libcamera/pipeline/mali-c55/mali-c55.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp index f5260f5f..4acc091b 100644 --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp @@ -157,15 +157,16 @@ int MaliC55CameraData::init() */ sensor_ = CameraSensorFactoryBase::create(entity_); if (!sensor_) - return ret; + return -ENODEV; const MediaPad *sourcePad = entity_->getPadByIndex(0); MediaEntity *csiEntity = sourcePad->links()[0]->sink()->entity(); csi_ = std::make_unique<V4L2Subdevice>(csiEntity); - if (csi_->open()) { + ret = csi_->open(); + if (ret) { LOG(MaliC55, Error) << "Failed to open CSI-2 subdevice"; - return false; + return ret; } return 0; |