[PATCH v2 5/6] media: uvcvideo: Remove redundant payload header length checks

From: Ricardo Ribalda

Date: Mon Nov 16 2026 - 12:52:35 EST


Now that uvc_video_decode_start() validates the header length, there is
no point in checking it again in the functions it calls. Some of those
checks are not complete and all are redundant.

Remove them.

Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
---
drivers/media/usb/uvc/uvc_video.c | 10 ----------
1 file changed, 10 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index a822b8234789..4e32600d9326 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -593,10 +593,6 @@ uvc_video_clock_decode(struct uvc_streaming *stream, struct uvc_buffer *buf,
break;
}

- /* Check for invalid headers. */
- if (len < header_size)
- return;
-
/*
* Extract the timestamps:
*
@@ -982,12 +978,6 @@ static void uvc_video_stats_decode(struct uvc_streaming *stream,
break;
}

- /* Check for invalid headers. */
- if (len < header_size || data[0] < header_size) {
- stream->stats.frame.nb_invalid++;
- return;
- }
-
/* Extract the timestamps. */
if (has_pts)
pts = get_unaligned_le32(&data[2]);

--
2.56.0.679.gc527c65306-goog