[PATCH v2 0/3] media: uvcvideo: Make sure the ctrl cache is in sync with the device

From: Ricardo Ribalda
Date: Mon Feb 24 2025 - 05:37:04 EST


Hans discovered a bug in the error handling of uvc_ctrl_commit(), lets
fix it.

It has been tested with v4l2-compliance -d /dev/video0

Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
---
Changes in v2:
- Fix commit message (Thanks Laurent).
- Change logic for err_ctrl. It looks nicer now.
- Link to v1: https://lore.kernel.org/r/20241210-uvc-data-backup-v1-0-77141e439cc3@xxxxxxxxxxxx

---
Ricardo Ribalda (3):
media: uvcvideo: Return the number of processed controls
media: uvcvideo: Send control events for partial succeeds
media: uvcvideo: Rollback non processed entities on error

drivers/media/usb/uvc/uvc_ctrl.c | 53 ++++++++++++++++++++++++++++++----------
1 file changed, 40 insertions(+), 13 deletions(-)
---
base-commit: c2b96a6818159fba8a3bcc38262da9e77f9b3ec7
change-id: 20241210-uvc-data-backup-a0a76df9aee9

Best regards,
--
Ricardo Ribalda <ribalda@xxxxxxxxxxxx>