* [PATCH 2.6]: Missing dev_put in qdisc_create error path
@ 2004-08-22 12:42 Patrick McHardy
2004-08-23 4:49 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Patrick McHardy @ 2004-08-22 12:42 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
[-- Attachment #1: Type: text/plain, Size: 103 bytes --]
This patch fixes missing dev_puts in qdisc_create and
qdisc_create_dflt error paths.
Regards
Patrick
[-- Attachment #2: 02-2.6-dev-leaks.diff --]
[-- Type: text/x-patch, Size: 1241 bytes --]
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/08/22 14:33:26+02:00 kaber@coreworks.de
# [PKT_SCHED]: Missing dev_put in error path
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
# net/sched/sch_generic.c
# 2004/08/22 14:33:06+02:00 kaber@coreworks.de +1 -0
# [PKT_SCHED]: Missing dev_put in error path
#
# net/sched/sch_api.c
# 2004/08/22 14:33:06+02:00 kaber@coreworks.de +3 -1
# [PKT_SCHED]: Missing dev_put in error path
#
diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c
--- a/net/sched/sch_api.c 2004-08-22 14:34:34 +02:00
+++ b/net/sched/sch_api.c 2004-08-22 14:34:34 +02:00
@@ -441,7 +441,7 @@
handle = qdisc_alloc_handle(dev);
err = -ENOMEM;
if (handle == 0)
- goto err_out2;
+ goto err_out3;
}
if (handle == TC_H_INGRESS)
@@ -464,6 +464,8 @@
#endif
return sch;
}
+err_out3:
+ dev_put(dev);
err_out2:
module_put(ops->owner);
err_out:
diff -Nru a/net/sched/sch_generic.c b/net/sched/sch_generic.c
--- a/net/sched/sch_generic.c 2004-08-22 14:34:34 +02:00
+++ b/net/sched/sch_generic.c 2004-08-22 14:34:34 +02:00
@@ -415,6 +415,7 @@
if (!ops->init || ops->init(sch, NULL) == 0)
return sch;
+ dev_put(dev);
kfree(p);
return NULL;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-08-23 4:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-22 12:42 [PATCH 2.6]: Missing dev_put in qdisc_create error path Patrick McHardy
2004-08-23 4:49 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).