Commit b3006397 authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Mauro Carvalho Chehab

media: cedrus: Add missing v4l2_ctrl_request_hdl_put()

The check for a required control in the request was missing a call to
v4l2_ctrl_request_hdl_put() in the error path. Fix it.

Fixes: 50e76151 ("media: platform: Add Cedrus VPU decoder driver")
Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 2e7c8fb8
...@@ -199,6 +199,7 @@ static int cedrus_request_validate(struct media_request *req) ...@@ -199,6 +199,7 @@ static int cedrus_request_validate(struct media_request *req)
struct v4l2_ctrl *ctrl_test; struct v4l2_ctrl *ctrl_test;
unsigned int count; unsigned int count;
unsigned int i; unsigned int i;
int ret = 0;
list_for_each_entry(obj, &req->objects, list) { list_for_each_entry(obj, &req->objects, list) {
struct vb2_buffer *vb; struct vb2_buffer *vb;
...@@ -243,12 +244,16 @@ static int cedrus_request_validate(struct media_request *req) ...@@ -243,12 +244,16 @@ static int cedrus_request_validate(struct media_request *req)
if (!ctrl_test) { if (!ctrl_test) {
v4l2_info(&ctx->dev->v4l2_dev, v4l2_info(&ctx->dev->v4l2_dev,
"Missing required codec control\n"); "Missing required codec control\n");
return -ENOENT; ret = -ENOENT;
break;
} }
} }
v4l2_ctrl_request_hdl_put(hdl); v4l2_ctrl_request_hdl_put(hdl);
if (ret)
return ret;
return vb2_request_validate(req); return vb2_request_validate(req);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment