lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <11734996641158-git-send-email-gregkh@suse.de>
Date:	Fri,  9 Mar 2007 20:07:32 -0800
From:	Greg Kroah-Hartman <gregkh@...e.de>
To:	linux-kernel@...r.kernel.org
Cc:	Dmitriy Monakhov <dmonakhov@...ru>,
	Monakhov Dmitriy <dmonakhov@...nvz.org>,
	Greg Kroah-Hartman <gregkh@...e.de>
Subject: [PATCH 5/5] kobject: new_device->kref wasn't putted after error in kobject_move()

From: Dmitriy Monakhov <dmonakhov@...ru>

If error happen we jump to "out" label, in this case new_device not yet
became the parent but it wasn't putted.

Signed-off-by: Monakhov Dmitriy <dmonakhov@...nvz.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
 lib/kobject.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lib/kobject.c b/lib/kobject.c
index f4f6176..057921c 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -385,9 +385,11 @@ int kobject_move(struct kobject *kobj, struct kobject *new_parent)
 		goto out;
 	old_parent = kobj->parent;
 	kobj->parent = new_parent;
+	new_parent = NULL;
 	kobject_put(old_parent);
 	kobject_uevent_env(kobj, KOBJ_MOVE, envp);
 out:
+	kobject_put(new_parent);
 	kobject_put(kobj);
 	kfree(devpath_string);
 	kfree(devpath);
-- 
1.5.0.2

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ