media: cedrus: fix double free
If v4l2_ctrl_new_custom fails in cedrus_init_ctrls the error path will free ctx->ctrls, which is also freed in cedrus release. Fix this by setting ctx->ctrls to NULL instead of inadvertently removing kfree calls. Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Родитель
fd2eda71a4
Коммит
fe47b6d758
|
@ -259,6 +259,7 @@ static int cedrus_init_ctrls(struct cedrus_dev *dev, struct cedrus_ctx *ctx)
|
|||
|
||||
v4l2_ctrl_handler_free(hdl);
|
||||
kfree(ctx->ctrls);
|
||||
ctx->ctrls = NULL;
|
||||
return hdl->error;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче