summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/device_enumerator_udev.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp
index 210f5c1f..c4077091 100644
--- a/src/libcamera/device_enumerator_udev.cpp
+++ b/src/libcamera/device_enumerator_udev.cpp
@@ -182,7 +182,8 @@ int DeviceEnumeratorUdev::populateMediaDevice(const std::shared_ptr<MediaDevice>
entity->deviceMinor());
/* Take device from orphan list first, if it is in the list. */
- if (std::find(orphans_.begin(), orphans_.end(), devnum) != orphans_.end()) {
+ auto orphan = std::find(orphans_.begin(), orphans_.end(), devnum);
+ if (orphan != orphans_.end()) {
std::string deviceNode = lookupDeviceNode(devnum);
if (deviceNode.empty())
return -EINVAL;
@@ -191,7 +192,7 @@ int DeviceEnumeratorUdev::populateMediaDevice(const std::shared_ptr<MediaDevice>
if (ret)
return ret;
- orphans_.remove(devnum);
+ orphans_.erase(orphan);
continue;
}