[PATCH 2/2] media: dvb-usb-v2: reallocate URBs after a failed reconfiguration

Chen Changcheng <[email protected]> Mon, 3 Aug 2026 17:45:39 +0800
Newsgroups org.kernel.vger.linux-media,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <[email protected]>
usb_urb_reconfig()'s "all fields are same" early-out only compares the
stream configuration fields; when a reconfiguration attempt failed, the
stream is left without URBs (urbs_initialized == 0 after the allocation
error path is fixed) and every later usb_urb_submitv2() call with a
matching configuration skips the reallocation, silently leaving the
stream without any submitted URBs.

Include urbs_initialized in the early-out condition, so that a stream
without URBs is always (re)built on the next submission, no matter which
configuration is requested.  This makes a failed reconfiguration
recoverable by the next start_feed() call.

Fixes: bce1c0290270 ("[media] dvb_usb_v2: dynamic USB stream URB configuration")
Cc: [email protected]
Signed-off-by: Chen Changcheng <[email protected]>
---
 drivers/media/usb/dvb-usb-v2/usb_urb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/dvb-usb-v2/usb_urb.c b/drivers/media/usb/dvb-usb-v2/usb_urb.c
index 9ba9aceabb5b..15603d448fc1 100644
--- a/drivers/media/usb/dvb-usb-v2/usb_urb.c
+++ b/drivers/media/usb/dvb-usb-v2/usb_urb.c
@@ -276,7 +276,8 @@ int usb_urb_reconfig(struct usb_data_stream *stream,
 	}
 
 	/* check if all fields are same */
-	if (stream->props.type == props->type &&
+	if (stream->urbs_initialized &&
+			stream->props.type == props->type &&
 			stream->props.count == props->count &&
 			stream->props.endpoint == props->endpoint) {
 		if (props->type == USB_BULK &&
-- 
2.25.1