]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PKT_SCHED]: Fix missing qdisc_destroy() in qdisc_create_dflt()
authorThomas Graf <tgraf@suug.ch>
Tue, 23 Aug 2005 17:12:44 +0000 (10:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Aug 2005 17:12:44 +0000 (10:12 -0700)
qdisc_create_dflt() is missing to destroy the newly allocated
default qdisc if the initialization fails resulting in leaks
of all kinds. The only caller in mainline which may trigger
this bug is sch_tbf.c in tbf_create_dflt_qdisc().

Note: qdisc_create_dflt() doesn't fulfill the official locking
      requirements of qdisc_destroy() but since the qdisc could
      never be seen by the outside world this doesn't matter
      and it can stay as-is until the locking of pkt_sched
      is cleaned up.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_generic.c

index 8edefd5d095d5019bae647ccc845314de65c5264..0d066c965342e5bbb93bcbe2a80cd4d39653028b 100644 (file)
@@ -438,6 +438,7 @@ struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct Qdisc_ops *ops)
        if (!ops->init || ops->init(sch, NULL) == 0)
                return sch;
 
+       qdisc_destroy(sch);
 errout:
        return NULL;
 }