diff mbox

fix dvb frontend lockup

Message ID 4BAE810A.6030405@free.fr (mailing list archive)
State Changes Requested
Headers show

Commit Message

Matthieu Castet March 27, 2010, 10:04 p.m. UTC
None
diff mbox

Patch

--- 1/linux/drivers/media/dvb/dvb-core/dvb_frontend.c	2010-03-27 22:59:50.000000000 +0100
+++ 2/linux/drivers/media/dvb/dvb-core/dvb_frontend.c	2010-03-27 23:01:34.000000000 +0100
@@ -686,7 +686,10 @@ 
 	}
 
 	fepriv->thread = NULL;
-	fepriv->exit = 0;
+	if (kthread_should_stop())
+		fepriv->exit = 2;
+	else
+		fepriv->exit = 0;
 	mb();
 
 	dvb_frontend_wakeup(fe);
@@ -1929,6 +1932,8 @@ 
 	int ret;
 
 	dprintk ("%s\n", __func__);
+	if (fepriv->exit == 2)
+		return -ENODEV;
 
 	if (adapter->mfe_shared) {
 		mutex_lock (&adapter->mfe_lock);
@@ -2021,7 +2026,7 @@ 
 	ret = dvb_generic_release (inode, file);
 
 	if (dvbdev->users == -1) {
-		if (fepriv->exit == 1) {
+		if (fepriv->exit) {
 			fops_put(file->f_op);
 			file->f_op = NULL;
 			wake_up(&dvbdev->wait_queue);