summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_net.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_net.c b/linux/drivers/media/dvb/dvb-core/dvb_net.c
index 529ba27b5..d9472a030 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_net.c
@@ -347,7 +347,7 @@ static
void dvb_net_set_multicast_list (struct net_device *dev)
{
struct dvb_net_priv *priv = (struct dvb_net_priv*) dev->priv;
- queue_task(&priv->tq, &tq_immediate);
+ schedule_task(&priv->tq);
}
@@ -488,10 +488,22 @@ int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid)
static
int dvb_net_remove_if(struct dvb_net *dvbnet, int num)
{
+ struct dvb_net_priv *priv = dvbnet->device[num].priv;
+ unsigned long flags;
+
if (!dvbnet->state[num])
return -EINVAL;
+
+ /**
+ * remove tq from task queue if it was scheduled before...
+ */
+ spin_lock_irqsave(&tqueue_lock, flags);
+ if (test_bit(0, &priv->tq.sync))
+ list_del(&priv->tq.list);
+ spin_unlock_irqrestore(&tqueue_lock, flags);
+
dvb_net_stop(&dvbnet->device[num]);
- kfree(dvbnet->device[num].priv);
+ kfree(priv);
unregister_netdev(&dvbnet->device[num]);
dvbnet->state[num]=0;
return 0;