aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-06-02 10:42:28 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-06-02 10:42:28 +0200
commitda302cc94160251d25653c67e6f8f191ee6ecb0f (patch)
tree314b00bc2347e37515816e0d068eceb241eab9bd
parent71c689dc2e732d4cb190aaf0edea73116b1611bd (diff)
mc-request.c: allow object_bind in QUEUED statebr-v5.14gfor-v5.14g
If a request was queued without a control handler object, and a control handler object is then created and bound to the request when copying controls on request completion, then a WARN_ON in mc-request.c is triggered since at that time the request is in state QUEUED, and not UPDATING. But this is too strict, and in this case it must also allow binding objects when in state QUEUED. This patch was unfortunately lost when the "always copy the controls on completion" patch was posted, it should have been part of that commit. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Fixes: c3bf5129f339 ("media: v4l2-ctrls: always copy the controls on completion")
-rw-r--r--drivers/media/mc/mc-request.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/mc/mc-request.c b/drivers/media/mc/mc-request.c
index c0782fd96c59..addb8f2d8939 100644
--- a/drivers/media/mc/mc-request.c
+++ b/drivers/media/mc/mc-request.c
@@ -414,7 +414,8 @@ int media_request_object_bind(struct media_request *req,
spin_lock_irqsave(&req->lock, flags);
- if (WARN_ON(req->state != MEDIA_REQUEST_STATE_UPDATING))
+ if (WARN_ON(req->state != MEDIA_REQUEST_STATE_UPDATING &&
+ req->state != MEDIA_REQUEST_STATE_QUEUED))
goto unlock;
obj->req = req;

Privacy Policy