Commit 838f7f95 authored by Alexander Viro's avatar Alexander Viro Committed by Jeff Garzik

[NET] fix leak in sch_teql

Also note the fact that we're calling functions that may block,
while holding a local spinlock.
parent e445a944
...@@ -475,8 +475,10 @@ int __init teql_init(void) ...@@ -475,8 +475,10 @@ int __init teql_init(void)
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;
if ((err = register_netdev(dev))) if ((err = register_netdev(dev))) {
free_netdev(dev);
goto out; goto out;
}
master = dev->priv; master = dev->priv;
spin_lock(&master_dev_lock); spin_lock(&master_dev_lock);
...@@ -497,6 +499,7 @@ static void __exit teql_exit(void) ...@@ -497,6 +499,7 @@ static void __exit teql_exit(void)
list_del(&master->master_list); list_del(&master->master_list);
unregister_qdisc(&master->qops); unregister_qdisc(&master->qops);
/* FIXME: we're inside a spinlock; unregister_netdev() blocks */
unregister_netdev(master->dev); unregister_netdev(master->dev);
free_netdev(master->dev); free_netdev(master->dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment