Skip to contentSkip to conversation

: Missing dev_put in qdisc_create error path

PATCH Applied Patrick McHardy 2 participants 2 messages Aug 22, 2004 – Aug 23, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Missing dev_put in qdisc_create error path

This patch fixes missing dev_puts in qdisc_create and qdisc_create_dflt error paths.

Regards
Patrick

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/08/22 14:33:26+02:00 [email protected]
# [PKT_SCHED]: Missing dev_put in error path
#
# Signed-off-by: Patrick McHardy <[email protected]>
#

# net/sched/sch_generic.c
#   2004/08/22 14:33:06+02:00 [email protected] +1 -0
#   [PKT_SCHED]: Missing dev_put in error path
# 
# net/sched/sch_api.c
#   2004/08/22 14:33:06+02:00 [email protected] +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:

net/sched/sch_generic.c +1 -0
diff -Nru a/net/sched/sch_generic.c b/net/sched/sch_generic.c
@@ -415,6 +415,7 @@
 	if (!ops->init || ops->init(sch, NULL) == 0)
 		return sch;
 
+	dev_put(dev);
 	kfree(p);
 	return NULL;
 }
#1 lore raw
Quoted 2 lines · On Sun, 22 Aug 2004 14:42:35 +0200 Patrick McHardy <[email protected]> wrote:

This patch fixes missing dev_puts in qdisc_create and qdisc_create_dflt error paths.

Applied, thanks Patrick.