]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
media: cedrus: Add missing v4l2_ctrl_request_hdl_put()
authorEzequiel Garcia <ezequiel@collabora.com>
Thu, 13 Aug 2020 19:18:33 +0000 (21:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Sep 2020 17:12:26 +0000 (19:12 +0200)
[ Upstream commit b30063976f29fc221a99d18d37d22ca035068aa9 ]

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: 50e761516f2b8c ("media: platform: Add Cedrus VPU decoder driver")
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/media/sunxi/cedrus/cedrus.c

index 3439f6ad63380270aaea2dd7e18d3ae75fe7a3dd..e80e82a276e93dd8f0ffd5ff34ca42b6fb00a493 100644 (file)
@@ -159,6 +159,7 @@ static int cedrus_request_validate(struct media_request *req)
        struct v4l2_ctrl *ctrl_test;
        unsigned int count;
        unsigned int i;
+       int ret = 0;
 
        list_for_each_entry(obj, &req->objects, list) {
                struct vb2_buffer *vb;
@@ -203,12 +204,16 @@ static int cedrus_request_validate(struct media_request *req)
                if (!ctrl_test) {
                        v4l2_info(&ctx->dev->v4l2_dev,
                                  "Missing required codec control\n");
-                       return -ENOENT;
+                       ret = -ENOENT;
+                       break;
                }
        }
 
        v4l2_ctrl_request_hdl_put(hdl);
 
+       if (ret)
+               return ret;
+
        return vb2_request_validate(req);
 }