diff mbox series

sun4i-csi: call _vb2_fop_release instead of v4l2_fh_release

Message ID 8002e999-feb5-8715-9e1a-ed67165ade7e@xs4all.nl (mailing list archive)
State New, archived
Headers show
Series sun4i-csi: call _vb2_fop_release instead of v4l2_fh_release | expand

Commit Message

Hans Verkuil July 7, 2020, 1:36 p.m. UTC
This driver didn't call _vb2_fop_release in the sun4i_csi_release
function. Without that call the vb2 queue is not properly canceled and
buffers may not be freed.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
Compile tested only due to lack of a suitable sensor.
I believe I do have an ov7670, but it's in the wrong country :-)
---

Comments

Maxime Ripard July 8, 2020, 5:50 p.m. UTC | #1
Hi Hans,

On Tue, Jul 07, 2020 at 03:36:47PM +0200, Hans Verkuil wrote:
> This driver didn't call _vb2_fop_release in the sun4i_csi_release
> function. Without that call the vb2 queue is not properly canceled and
> buffers may not be freed.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

Acked-by: Maxime Ripard <mripard@kernel.org>

Thanks!
Maxime
diff mbox series

Patch

diff --git a/drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c b/drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c
index 1721e5aee9c6..8f4e254b6a41 100644
--- a/drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c
+++ b/drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c
@@ -242,7 +242,8 @@  static int sun4i_csi_release(struct file *file)

 	mutex_lock(&csi->lock);

-	v4l2_fh_release(file);
+	_vb2_fop_release(file, NULL);
+
 	v4l2_pipeline_pm_put(&csi->vdev.entity);
 	pm_runtime_put(csi->dev);