From: Hans Verkuil Date: Mon, 15 Jun 2015 11:33:40 +0000 (-0300) Subject: [media] soc_camera: always release queue for queue owner X-Git-Tag: firefly_0821_release~176^2~795^2~267 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=16225ea7fa6843482c562f033b7ec270651636e9;p=firefly-linux-kernel-4.4.55.git [media] soc_camera: always release queue for queue owner Always release the queue if the owner closes its filehandle and not when it is the last open filehandle. Signed-off-by: Hans Verkuil Acked-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c index 0b09281bdd7f..9087fed586fb 100644 --- a/drivers/media/platform/soc_camera/soc_camera.c +++ b/drivers/media/platform/soc_camera/soc_camera.c @@ -788,20 +788,21 @@ static int soc_camera_close(struct file *file) struct soc_camera_host *ici = to_soc_camera_host(icd->parent); mutex_lock(&ici->host_lock); + if (icd->streamer == file) { + if (ici->ops->init_videobuf2) + vb2_queue_release(&icd->vb2_vidq); + icd->streamer = NULL; + } icd->use_count--; if (!icd->use_count) { pm_runtime_suspend(&icd->vdev->dev); pm_runtime_disable(&icd->vdev->dev); - if (ici->ops->init_videobuf2) - vb2_queue_release(&icd->vb2_vidq); __soc_camera_power_off(icd); soc_camera_remove_device(icd); } - if (icd->streamer == file) - icd->streamer = NULL; mutex_unlock(&ici->host_lock); module_put(ici->ops->owner);