diff options
author | Johannes Stezenbach <devnull@localhost> | 2004-05-05 18:25:43 +0000 |
---|---|---|
committer | Johannes Stezenbach <devnull@localhost> | 2004-05-05 18:25:43 +0000 |
commit | f42bc240e3f18da6d9814d1673ab8c3302666b08 (patch) | |
tree | a4c42f6a31041d2507fd770df62d87874d66632f | |
parent | fc4dad4de8686ebdefa5d5bf929bbbf89a9eb83a (diff) | |
download | mediapointer-dvb-s2-f42bc240e3f18da6d9814d1673ab8c3302666b08.tar.gz mediapointer-dvb-s2-f42bc240e3f18da6d9814d1673ab8c3302666b08.tar.bz2 |
protect feed_list with spin_locks (possibly fixes crashes on SMP)
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_demux.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_demux.c b/linux/drivers/media/dvb/dvb-core/dvb_demux.c index e4e4e8f49..18be3f964 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_demux.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_demux.c @@ -571,24 +571,30 @@ static int dvb_demux_feed_find(struct dvb_demux_feed *feed) static void dvb_demux_feed_add(struct dvb_demux_feed *feed) { + spin_lock(&feed->demux->lock); if (dvb_demux_feed_find(feed)) { printk(KERN_ERR "%s: feed already in list (type=%x state=%x pid=%x)\n", __FUNCTION__, feed->type, feed->state, feed->pid); - return; + goto out; } list_add(&feed->list_head, &feed->demux->feed_list); +out: + spin_unlock(&feed->demux->lock); } static void dvb_demux_feed_del(struct dvb_demux_feed *feed) { + spin_lock(&feed->demux->lock); if (!(dvb_demux_feed_find(feed))) { printk(KERN_ERR "%s: feed not in list (type=%x state=%x pid=%x)\n", __FUNCTION__, feed->type, feed->state, feed->pid); - return; + goto out; } list_del(&feed->list_head); +out: + spin_unlock(&feed->demux->lock); } static int dmx_ts_feed_set (struct dmx_ts_feed* ts_feed, u16 pid, int ts_type, |