Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: uvcvideo: Return queued buffers on start_streaming() failure

Return buffers if streaming fails to start due to uvc_pm_get() error.

This bug may be responsible for a warning I got running

while :; do yavta -c3 /dev/video0; done

on an xHCI controller which failed under this workload.
I had no luck reproducing this warning again to confirm.

xhci_hcd 0000:09:00.0: HC died; cleaning up
usb 13-2: USB disconnect, device number 2
WARNING: CPU: 2 PID: 29386 at drivers/media/common/videobuf2/videobuf2-core.c:1803 vb2_start_streaming+0xac/0x120

Fixes: 7dd56c47784a ("media: uvcvideo: Remove stream->is_streaming field")
Cc: stable@vger.kernel.org
Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patch.msgid.link/20251015133642.3dede646.michal.pecio@gmail.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Michal Pecio and committed by
Hans Verkuil
4cf3b6fd 3d9f32e0

+7 -5
+7 -5
drivers/media/usb/uvc/uvc_queue.c
··· 177 177 178 178 ret = uvc_pm_get(stream->dev); 179 179 if (ret) 180 - return ret; 180 + goto err_buffers; 181 181 182 182 queue->buf_used = 0; 183 183 184 184 ret = uvc_video_start_streaming(stream); 185 - if (ret == 0) 186 - return 0; 185 + if (ret) 186 + goto err_pm; 187 187 188 + return 0; 189 + 190 + err_pm: 188 191 uvc_pm_put(stream->dev); 189 - 192 + err_buffers: 190 193 uvc_queue_return_buffers(queue, UVC_BUF_STATE_QUEUED); 191 - 192 194 return ret; 193 195 } 194 196