netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@redhat.com>
Cc: netdev@oss.sgi.com
Subject: [PATCH 2.6]: Missing dev_put in qdisc_create error path
Date: Sun, 22 Aug 2004 14:42:35 +0200	[thread overview]
Message-ID: <412894BB.9090906@trash.net> (raw)

[-- 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;
 }

             reply	other threads:[~2004-08-22 12:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-22 12:42 Patrick McHardy [this message]
2004-08-23  4:49 ` [PATCH 2.6]: Missing dev_put in qdisc_create error path David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=412894BB.9090906@trash.net \
    --to=kaber@trash.net \
    --cc=davem@redhat.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).