[RFC,v1,26/27] v4l2: v4l2_camera: Always clear pending requests
diff mbox series

Message ID 20260618123844.656396-27-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • Misc. changes before request-buffer split
Related show

Commit Message

Barnabás Pőcze June 18, 2026, 12:38 p.m. UTC
Clear the list of pending requests regardless whether the camera is running
or not. The list should only contain entries when `!isRunning_`, in which
case it was not cleared previously.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 src/v4l2/v4l2_camera.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp
index e72b73a22a..8c7de8e92b 100644
--- a/src/v4l2/v4l2_camera.cpp
+++ b/src/v4l2/v4l2_camera.cpp
@@ -226,6 +226,8 @@  int V4L2Camera::streamOn()
 
 int V4L2Camera::streamOff()
 {
+	pendingRequests_.clear();
+
 	if (!isRunning_) {
 		for (std::unique_ptr<Request> &req : requestPool_)
 			req->reuse();
@@ -233,8 +235,6 @@  int V4L2Camera::streamOff()
 		return 0;
 	}
 
-	pendingRequests_.clear();
-
 	int ret = camera_->stop();
 	if (ret < 0)
 		return ret == -EACCES ? -EBUSY : ret;