On Thu Mar 19 01:59:03 2026 +0200, Laurent Pinchart wrote:
> The histogram media bus code enumeration does not check the index when
> operating on the source pad, resulting in an infinite loop if userspace
> keeps enumerating code without any loop boundary. Fix it by returning an
> error for indices larger than 0 as the pad supports a single format.
>
> Tested-by: Lad Prabhakar <[email protected]> # HiHope
> RZ/G2M
> Link:
> https://patch.msgid.link/20260318235907.831556-10-laurent.pinchart+rene...@ideasonboard.com
> Signed-off-by: Laurent Pinchart <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>
Patch committed.
Thanks,
Hans Verkuil
drivers/media/platform/renesas/vsp1/vsp1_histo.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/drivers/media/platform/renesas/vsp1/vsp1_histo.c
b/drivers/media/platform/renesas/vsp1/vsp1_histo.c
index d7843c170f94..f97aecb22058 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_histo.c
+++ b/drivers/media/platform/renesas/vsp1/vsp1_histo.c
@@ -168,7 +168,10 @@ static int histo_enum_mbus_code(struct v4l2_subdev *subdev,
struct v4l2_subdev_mbus_code_enum *code)
{
if (code->pad == HISTO_PAD_SOURCE) {
- code->code = MEDIA_BUS_FMT_FIXED;
+ if (code->index > 0)
+ return -EINVAL;
+
+ code->code = MEDIA_BUS_FMT_METADATA_FIXED;
return 0;
}
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]