diff options
author | Mike Isely <isely@pobox.com> | 2008-02-05 22:24:51 -0600 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2008-02-05 22:24:51 -0600 |
commit | 9c861211b25ec3dd761908391b28ec6e19dbcd2d (patch) | |
tree | 09ed7313ebc13989492e56bf0e657068dacba244 /linux | |
parent | e02d478c909e673b7ec2db5cb4c0f59addc9c92f (diff) | |
download | mediapointer-dvb-s2-9c861211b25ec3dd761908391b28ec6e19dbcd2d.tar.gz mediapointer-dvb-s2-9c861211b25ec3dd761908391b28ec6e19dbcd2d.tar.bz2 |
pvrusb2: Fix oops in pvrusb2-dvb
From: Mike Isely <isely@pobox.com>
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>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c b/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c index 433e65383..8e189cc37 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c @@ -143,9 +143,8 @@ static void pvr2_dvb_fh_done(struct pvr2_dvb_fh *fh) 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; int ret; unsigned int count; @@ -208,12 +207,18 @@ static int pvr2_dvb_feed_thread(void *data) 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: */ while (!kthread_should_stop()) { set_current_state(TASK_INTERRUPTIBLE); schedule(); } - return 0; + return stat; } static int pvr2_dvb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) |