Skip to content

Commit 83dfbd3

Browse files
smaeulgregkh
authored andcommitted
media: cedrus: Fix missing cleanup in error path
commit d997323 upstream. According to the documentation struct v4l2_fh has to be cleaned up with v4l2_fh_exit() before being freed. [1] Currently there is no actual bug here, when v4l2_fh_exit() isn't called. v4l2_fh_exit() in this case only destroys internal mutex. But it may change in the future, when v4l2_fh_init/v4l2_fh_exit will be enhanced. 1. https://docs.kernel.org/driver-api/media/v4l2-fh.html Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com> Fixes: 50e7615 ("media: platform: Add Cedrus VPU decoder driver") Cc: stable@vger.kernel.org Acked-by: Paul Kocialkowski <paulk@sys-base.io> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 378bd9c commit 83dfbd3

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • drivers/staging/media/sunxi/cedrus

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ static int cedrus_open(struct file *file)
392392
err_m2m_release:
393393
v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
394394
err_free:
395+
v4l2_fh_exit(&ctx->fh);
395396
kfree(ctx);
396397
mutex_unlock(&dev->dev_mutex);
397398

0 commit comments

Comments
 (0)