Kate Hsuan d38106e308 media: uvcvideo: Fix allocation for small frame sizes
JIRA: https://redhat.atlassian.net/browse/RHEL-162130

commit 40d3ac25c11310bfaa50ed7614846ef75cb69a1e
Author: Ricardo Ribalda <ribalda@chromium.org>
Date: Wed, 14 Jan 2026 10:32:13 +0000

  If a frame has size of less or equal than one packet size
  uvc_alloc_urb_buffers() is unable to allocate memory for it due to a
  off-by-one error.

  Fix the off-by-one-error and now that we are at it, make sure that
  stream->urb_size has always a valid value when we return from the
  function, even when an error happens.

  Fixes: efdc8a9585 ("V4L/DVB (10295): uvcvideo: Retry URB buffers allocation when the system is low on memory.")
  Reported-by: Itay Chamiel <itay.chamiel@q.ai>
  Closes: https://lore.kernel.org/linux-media/CANiDSCsSoZf2LsCCoWAUbCg6tJT-ypXR1B85aa6rAdMVYr2iBQ@mail.gmail.com/T/#t
  Co-developed-by: Itay Chamiel <itay.chamiel@q.ai>
  Signed-off-by: Itay Chamiel <itay.chamiel@q.ai>
  Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
  Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  Tested-by: Itay Chamiel <itay.chamiel@q.ai>
  Link: https://patch.msgid.link/20260114-uvc-alloc-urb-v1-1-cedf3fb66711@chromium.org
  Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

Signed-off-by: Kate Hsuan <hpa@redhat.com>
2026-05-15 14:41:30 +08:00
2026-05-12 08:15:43 +00:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
S
Description
No description provided
Readme
2.8 GiB
Languages
C 97.6%
Assembly 1%
Shell 0.5%
Python 0.3%
Makefile 0.3%
Other 0.1%