mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniele Bellucci <dbellucci@mybox.it>
To: linux-kernel@vger.kernel.org
Cc: kernel-janitor-discuss@lists.sourceforge.net
Subject: [DVB] PATCH: Handling failure of dvb_frontend_start in dvb_frontend_open [2.5.69-70]
Date: Tue, 3 Jun 2003 22:34:57 +0200	[thread overview]
Message-ID: <200306032234.57209.dbellucci@mybox.it> (raw)

This patch applies both to 2.5.69 and to 2.5.70


diff -urN linux-2.5.69-my/drivers/media/dvb/dvb-core/dvb_frontend.c linux-2.5.69/drivers/media/dvb/dvb-core/dvb_frontend.c
--- linux-2.5.69-my/drivers/media/dvb/dvb-core/dvb_frontend.c	2003-06-03 21:54:32.000000000 +0200
+++ linux-2.5.69/drivers/media/dvb/dvb-core/dvb_frontend.c	2003-06-03 22:08:07.000000000 +0200
@@ -20,6 +20,10 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
+ *
+ * Changes:
+ * 03/06/2003:   handling failure of dvb_frontend_start in dvb_frontend_open
+ *               Daniele Bellucci <bellucda@tiscali.it>.
  */
 
 #include <linux/sched.h>
@@ -527,20 +531,21 @@
 
 
 static
-void dvb_frontend_start (struct dvb_frontend_data *fe)
+pid_t dvb_frontend_start (struct dvb_frontend_data *fe)
 {
+	pid_t dvb_kthread;
 	dprintk ("%s\n", __FUNCTION__);
 
 	if (fe->thread)
 		dvb_frontend_stop (fe);
 
 	if (down_interruptible (&fe->sem))
-		return;
+		return -ERESTARTSYS;
 
 	fe->exit = 0;
 	fe->thread = (void*) ~0;
 
-	kernel_thread (dvb_frontend_thread, fe, 0);
+	return kernel_thread (dvb_frontend_thread, fe, 0);
 }
 
 
@@ -610,6 +615,7 @@
 {
 	struct dvb_device *dvbdev = file->private_data;
 	struct dvb_frontend_data *fe = dvbdev->priv;
+	pid_t dvb_kthread;
 	int ret;
 
 	dprintk ("%s\n", __FUNCTION__);
@@ -618,12 +624,18 @@
 		return ret;
 
 	if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
-		dvb_frontend_start (fe);
+		dvb_kthread = dvb_frontend_start (fe);
+		if (dvb_kthread < 0) {
+			ret = dvb_kthread;
+			dvb_generic_release(inode, file);
+			goto out;
+		}
+	}
 
 		/*  empty event queue */
 		fe->events.eventr = fe->events.eventw;
 	}
-	
+out:
 	return ret;
 }
 

please apply.

Daniele Bellucci.





                 reply	other threads:[~2003-06-03 20:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200306032234.57209.dbellucci@mybox.it \
    --to=dbellucci@mybox.it \
    --cc=kernel-janitor-discuss@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®