media: v4l2-ctrls-api.c: add back dropped ctrl->is_new = 1
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 12 Dec 2022 08:32:20 +0000 (08:32 +0000)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Wed, 14 Dec 2022 18:10:41 +0000 (18:10 +0000)
The patch adding support for dynamically allocated arrays accidentally
dropped the line setting ctrl->is_new to 1, thus new string values were
always ignored.

Fixes: fb582cba4492 ("media: v4l2-ctrls: add support for dynamically allocated arrays.")
Reported-by: Alice Yuan <alice.yuan@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/v4l2-core/v4l2-ctrls-api.c

index d0a3aa3..3d3b6dc 100644 (file)
@@ -150,6 +150,7 @@ static int user_to_new(struct v4l2_ext_control *c, struct v4l2_ctrl *ctrl)
                         * then return an error.
                         */
                        if (strlen(ctrl->p_new.p_char) == ctrl->maximum && last)
+                       ctrl->is_new = 1;
                                return -ERANGE;
                }
                return ret;