Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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 <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
16225ea7 2d703835

+5 -4
+5 -4
drivers/media/platform/soc_camera/soc_camera.c
··· 788 788 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 789 789 790 790 mutex_lock(&ici->host_lock); 791 + if (icd->streamer == file) { 792 + if (ici->ops->init_videobuf2) 793 + vb2_queue_release(&icd->vb2_vidq); 794 + icd->streamer = NULL; 795 + } 791 796 icd->use_count--; 792 797 if (!icd->use_count) { 793 798 pm_runtime_suspend(&icd->vdev->dev); 794 799 pm_runtime_disable(&icd->vdev->dev); 795 800 796 - if (ici->ops->init_videobuf2) 797 - vb2_queue_release(&icd->vb2_vidq); 798 801 __soc_camera_power_off(icd); 799 802 800 803 soc_camera_remove_device(icd); 801 804 } 802 805 803 - if (icd->streamer == file) 804 - icd->streamer = NULL; 805 806 mutex_unlock(&ici->host_lock); 806 807 807 808 module_put(ici->ops->owner);