Re: [PATCH] media: uvcvideo: Skip frame descriptors with a zero computed size

From: Natasha Klaus

Date: Tue Aug 18 2026 - 06:42:47 EST


Understood on the placement, thanks.

One finding while building your refactor: it does not compile as written.
Dropping the uvc_dbg() removes the last use of alts in uvc_parse_frame(), and
the kernel treats that as an error:

drivers/media/usb/uvc/uvc_driver.c:233:36: error: unused variable 'alts'
[-Werror=unused-variable]

I removed the now-dead declaration, which adds a hunk you did not specify. Say
if you would rather keep alts and identify the device explicitly in the
dev_warn() instead.

I also wrote the dev_warn() text, since you specified the level but not the
wording:

dev_warn(&streaming->intf->dev,
"UVC non compliance: FRAME descriptor is %d bytes, expected at least %u.\n",
buflen, 26 + 4 * n);

Happy to change it.

To carry your refactor as 1/3 with you as author I need your Signed-off-by.
Could you send it, or tell me if you would rather I take authorship with a
Suggested-by: line pointing at your message.

Natasha