[PATCH v3 0/2] media: go7007: return buffers to vb2 from the streaming paths

From: YuanZhe Liu

Date: Wed Nov 25 2026 - 04:18:06 EST


go7007 hands queued buffers to vb2 in buf_queue(), but neither of its
streaming teardown paths gives them back: start_streaming() returns -EIO
without returning the buffers it was given, and stop_streaming() drops
them by re-initializing go->vidq_active. Both violate the vb2 buffer
ownership rules and trigger the corresponding checks in
vb2_start_streaming() and __vb2_queue_cancel().

Patch 1 returns the queued buffers with VB2_BUF_STATE_QUEUED when
start_streaming() fails. Patch 2 returns the pending buffers with
VB2_BUF_STATE_ERROR in stop_streaming().

Changes in v3:
- Walk go->vidq_active directly in start_streaming() instead of splicing
it onto a local list.
- Add the stop_streaming() fix requested by Hans.

Changes in v2:
- Inline the buffer return into go7007_start_streaming() and drop the
separate helper.
- Drop the redundant go->active_buf = NULL from that path.

YuanZhe Liu (2):
media: go7007: return queued buffers on start_streaming() failure
media: go7007: return pending buffers on stop_streaming()

drivers/media/usb/go7007/go7007-v4l2.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)

--
2.34.1