]> git.baikalelectronics.ru Git - kernel.git/commit
media: v4l2-ctrls: v4l2_ctrl_request_complete() should always set ref->req
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 3 Mar 2020 10:34:48 +0000 (11:34 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 5 Mar 2020 21:48:56 +0000 (22:48 +0100)
commit978f3db0692b6f903e3495bd591972dee1efdc28
tree48fc14cbb531f8e27e7799cc95e4ed9937cbcddf
parent1556ede33d07fbb83d8c25256055cf869f62e3cc
media: v4l2-ctrls: v4l2_ctrl_request_complete() should always set ref->req

When the request is completed, all controls are copied to the request object.
However, when VIDIOC_G_EXT_CTRLS attempts to read control values from the
request it will read the current value instead for any control reference that
has a NULL ref->req pointer. But that's wrong: after completing the request
*all* controls should have a non-NULL ref->req pointer since they are after
all copied to the request.

So set ref->req if it wasn't set already.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/v4l2-core/v4l2-ctrls.c