linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] cx231xx: fix close sequence for VBI + analog
@ 2016-01-29 18:36 Jean-Baptiste Theou
  2016-01-29 19:05 ` [PATCH v2] " Jean-Baptiste Theou
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Baptiste Theou @ 2016-01-29 18:36 UTC (permalink / raw)
  To: linux-media; +Cc: Jean-Baptiste Theou

For tuners with no_alt_vanc=0, and VBI and analog video device
open.
There is two ways to close the devices:

*First way (start with user=2)

VBI first (user=1): URBs for the VBI are killed properly
with cx231xx_uninit_vbi_isoc

Analog second (user=0): URBs for the Analog are killed
properly with cx231xx_uninit_isoc

*Second way (start with user=2)

Analog first (user=1): URBs for the Analog are NOT killed
properly with cx231xx_uninit_isoc, because the exit path
is not called this time.

VBI first (user=0): URBs for the VBI are killed properly with
cx231xx_uninit_vbi_isoc, but we are exiting the function
without killing the URBs for the Analog

This situation lead to various kernel panics, since
the URBs are still processed, without the device been
open.

The patch fix the issue by calling the exit path no matter
what, when user=0, plus remove a duplicate trace.

Signed-off-by: Jean-Baptiste Theou <jtheou@adeneo-embedded.us>
---
 drivers/media/usb/cx231xx/cx231xx-video.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
index 9b88cd8..559ca77 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -1836,7 +1836,6 @@ static int cx231xx_close(struct file *filp)
 
 	cx231xx_videodbg("users=%d\n", dev->users);
 
-	cx231xx_videodbg("users=%d\n", dev->users);
 	if (res_check(fh))
 		res_free(fh);
 
@@ -1870,13 +1869,6 @@ static int cx231xx_close(struct file *filp)
 				cx231xx_set_alt_setting(dev, INDEX_VANC, 0);
 			else
 				cx231xx_set_alt_setting(dev, INDEX_HANC, 0);
-
-			v4l2_fh_del(&fh->fh);
-			v4l2_fh_exit(&fh->fh);
-			kfree(fh);
-			dev->users--;
-			wake_up_interruptible(&dev->open);
-			return 0;
 		}
 
 	v4l2_fh_del(&fh->fh);
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-03-24  5:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-29 18:36 [PATCH] [media] cx231xx: fix close sequence for VBI + analog Jean-Baptiste Theou
2016-01-29 19:05 ` [PATCH v2] " Jean-Baptiste Theou
2016-02-01 15:33   ` Mauro Carvalho Chehab
2016-02-01 17:47     ` Jean-Baptiste Theou
2016-03-24  4:51       ` Luke Suchocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).