V4L/DVB (7687): pvrusb2: Fix oops in pvrusb2-dvb
The pvrusb2-dvb feed thread cannot be allowed to exit by itself without first waiting for kthread_should_stop() to return true. Otherwise the driver will have a dangling task_struct context, which will cause a very nasty kernel oops. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
e2780fb411
commit
ceb4340deb
@ -138,9 +138,8 @@ static void pvr2_dvb_fh_done(struct pvr2_dvb_fh *fh)
|
|||||||
pvr2_channel_done(&fh->channel);
|
pvr2_channel_done(&fh->channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pvr2_dvb_feed_thread(void *data)
|
static int pvr2_dvb_feed_func(struct pvr2_dvb_adapter *adap)
|
||||||
{
|
{
|
||||||
struct pvr2_dvb_adapter *adap = data;
|
|
||||||
struct pvr2_dvb_fh fh;
|
struct pvr2_dvb_fh fh;
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
@ -203,12 +202,18 @@ static int pvr2_dvb_feed_thread(void *data)
|
|||||||
|
|
||||||
printk(KERN_DEBUG "dvb thread stopped\n");
|
printk(KERN_DEBUG "dvb thread stopped\n");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int pvr2_dvb_feed_thread(void *data)
|
||||||
|
{
|
||||||
|
int stat = pvr2_dvb_feed_func(data);
|
||||||
/* from videobuf-dvb.c: */
|
/* from videobuf-dvb.c: */
|
||||||
while (!kthread_should_stop()) {
|
while (!kthread_should_stop()) {
|
||||||
set_current_state(TASK_INTERRUPTIBLE);
|
set_current_state(TASK_INTERRUPTIBLE);
|
||||||
schedule();
|
schedule();
|
||||||
}
|
}
|
||||||
return 0;
|
return stat;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pvr2_dvb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
|
static int pvr2_dvb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user