Skip to content

Commit b300639

Browse files
ezequielgarciamchehab
authored andcommitted
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: 50e7615 ("media: platform: Add Cedrus VPU decoder driver") Signed-off-by: Ezequiel Garcia <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 2e7c8fb commit b300639

File tree

1 file changed

+6
-1
lines changed
  • drivers/staging/media/sunxi/cedrus

1 file changed

+6
-1
lines changed

drivers/staging/media/sunxi/cedrus/cedrus.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ static int cedrus_request_validate(struct media_request *req)
199199
struct v4l2_ctrl *ctrl_test;
200200
unsigned int count;
201201
unsigned int i;
202+
int ret = 0;
202203

203204
list_for_each_entry(obj, &req->objects, list) {
204205
struct vb2_buffer *vb;
@@ -243,12 +244,16 @@ static int cedrus_request_validate(struct media_request *req)
243244
if (!ctrl_test) {
244245
v4l2_info(&ctx->dev->v4l2_dev,
245246
"Missing required codec control\n");
246-
return -ENOENT;
247+
ret = -ENOENT;
248+
break;
247249
}
248250
}
249251

250252
v4l2_ctrl_request_hdl_put(hdl);
251253

254+
if (ret)
255+
return ret;
256+
252257
return vb2_request_validate(req);
253258
}
254259

0 commit comments

Comments
 (0)