* [DVB] PATCH: Handling failure of dvb_frontend_start in dvb_frontend_open [2.5.69-70]
@ 2003-06-03 20:34 Daniele Bellucci
0 siblings, 0 replies; only message in thread
From: Daniele Bellucci @ 2003-06-03 20:34 UTC (permalink / raw)
To: linux-kernel; +Cc: kernel-janitor-discuss
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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-06-03 20:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-03 20:34 [DVB] PATCH: Handling failure of dvb_frontend_start in dvb_frontend_open [2.5.69-70] Daniele Bellucci
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).