public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Christian Kujau <evil@g-house.de>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Pekka Enberg <penberg@gmail.com>,
	Matt_Domsch@dell.com
Subject: [PATCH] kobject: fix double kobject_put() in error path of kobject_add()
Date: Tue, 9 Nov 2004 11:04:21 -0800	[thread overview]
Message-ID: <20041109190420.GA2498@kroah.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0411091026520.2301@ppc970.osdl.org>

This fixes a problem introduced in the previous set of driver model
changes that has been seen by a lot of people (most notibly the greater
than 256 pty users, but others might also be hitting this without
realizing it.)

Also add a comment so we don't try to "fix" this again.

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>

--- a/lib/kobject.c	2004-11-05 10:06:33 -08:00
+++ b/lib/kobject.c	2004-11-08 23:58:02 -08:00
@@ -181,10 +181,10 @@ int kobject_add(struct kobject * kobj)
 
 	error = create_dir(kobj);
 	if (error) {
+		/* unlink does the kobject_put() for us */
 		unlink(kobj);
 		if (parent)
 			kobject_put(parent);
-		kobject_put(kobj);
 	} else {
 		kobject_hotplug(kobj, KOBJ_ADD);
 	}

  reply	other threads:[~2004-11-09 19:04 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4180F026.9090302@g-house.de>
2004-10-28 13:29 ` [Alsa-devel] Oops in 2.6.10-rc1 Jaroslav Kysela
2004-10-28 14:09   ` Christian
2004-11-04 15:16     ` Christian Kujau
2004-11-05  2:35       ` Christian Kujau
2004-11-07  1:24       ` Christian Kujau
2004-11-07  7:02         ` Linus Torvalds
2004-11-07 13:10           ` Christian Kujau
2004-11-07 16:02             ` Christian Kujau
2004-11-07 16:57               ` Linus Torvalds
2004-11-07 18:31                 ` Christian Kujau
2004-11-07 18:44                   ` Linus Torvalds
2004-11-07 23:45                   ` Christian Kujau
2004-11-08  1:16                     ` Linus Torvalds
2004-11-08 13:01                       ` Christian Kujau
2004-11-08 18:13                         ` Linus Torvalds
2004-11-08 20:59                           ` Christian Kujau
2004-11-08 23:49                             ` Christian Kujau
2004-11-09  1:05                               ` Linus Torvalds
2004-11-09  1:41                                 ` Christian Kujau
2004-11-09  1:31                               ` Christian Kujau
2004-11-09  7:40                                 ` Pekka Enberg
2004-11-09 12:33                                   ` Christian Kujau
2004-11-09 17:26                                     ` Oops in 2.6.10-rc1 (almost solved) Christian Kujau
2004-11-09 18:53                                       ` Linus Torvalds
2004-11-09 19:04                                         ` Greg KH [this message]
2004-11-09 19:08                                           ` [PATCH] kobject: fix double kobject_put() in error path of kobject_add() Greg KH
2004-11-09 20:19                                             ` Pekka Enberg
2004-11-09 21:21                                             ` Christian Kujau
2004-11-09 21:31                                             ` Christian Kujau
2004-11-09 19:09                                           ` Linus Torvalds
2004-11-09 22:06                                             ` Christian Kujau
2004-11-09 23:30                                         ` Oops in 2.6.10-rc1 (almost solved) Christian Kujau
2004-11-09 23:40                                           ` Matt Domsch
2004-11-10  0:21                                             ` Christian Kujau
2004-11-10  1:01                                               ` Linus Torvalds
2004-11-11 22:43                                             ` Matt Domsch
2004-11-11 22:53                                               ` Linus Torvalds
2004-11-11 22:55                                                 ` Matt Domsch
2004-11-12  0:27                                               ` Christian Kujau
2004-11-12  0:49                                                 ` Linus Torvalds
2004-11-12  1:27                                                   ` Christian Kujau
2004-11-10  0:12                           ` Oops in 2.6.10-rc1 Christian Kujau
2004-11-10  0:23                             ` Linus Torvalds
2004-11-08 18:44                         ` Pekka Enberg
2004-11-08 19:00                           ` Greg KH
2004-11-08 19:18                             ` Pekka Enberg
2004-11-08 19:30                               ` Pekka Enberg
2004-11-08 20:31                               ` Christian Kujau
2004-11-07 13:05         ` Pekka Enberg
2004-11-07 13:43           ` Christian Kujau

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=20041109190420.GA2498@kroah.com \
    --to=greg@kroah.com \
    --cc=Matt_Domsch@dell.com \
    --cc=evil@g-house.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@gmail.com \
    --cc=torvalds@osdl.org \
    /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