All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Mark kobjects as unitialized
@ 2008-03-06 16:53 ` Balaji Rao
  0 siblings, 0 replies; 37+ messages in thread
From: Balaji Rao @ 2008-03-06 16:53 UTC (permalink / raw)
  To: gregkh; +Cc: kvm-devel, linux-kernel

Hi greg,

When I remove only the kvm-intel module without removing the kvm module itself, I get an error saying that a kobject is 
trying to be reinitialized. Its because of the fact that kvm reuses a kobject in kvm_init when calling sysdev_register.

This patch fixes kobject_cleanup by marking the kobject as uninitialized when we cleanup to allow kobjects to be reused.

Signed-off-by: Balaji Rao <balajirrao@gmail.com>

diff --git a/lib/kobject.c b/lib/kobject.c
index 0d03252..fbdefb8 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -577,6 +577,9 @@ static void kobject_cleanup(struct kobject *kobj)
 		pr_debug("kobject: '%s': free name\n", name);
 		kfree(name);
 	}
+
+	/* Set the state to uninitialized */
+	kobj->state_initialized = 0;
 }
 
 static void kobject_release(struct kref *kref)

-- 
regards,
balaji rao
3rd year, Dept. of Mechanical Engineering,
National Institute of Technology, Karnataka

^ permalink raw reply related	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2008-03-10 17:24 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-06 16:53 [PATCH] Mark kobjects as unitialized Balaji Rao
2008-03-06 16:53 ` Balaji Rao
2008-03-06 17:05 ` Greg KH
2008-03-06 17:05   ` Greg KH
2008-03-06 17:50   ` Balaji Rao
2008-03-06 17:50     ` Balaji Rao
2008-03-06 18:05     ` Greg KH
2008-03-06 18:05       ` Greg KH
2008-03-07  8:56       ` [kvm-devel] " Avi Kivity
2008-03-07  8:56         ` Avi Kivity
2008-03-08 22:07       ` Balaji Rao
2008-03-09  5:06         ` Greg KH
2008-03-09  5:06           ` Greg KH
2008-03-09  6:16           ` Greg KH
2008-03-09  6:16             ` Greg KH
2008-03-09  6:17           ` Balaji Rao
2008-03-09  6:17             ` Balaji Rao
2008-03-09  6:33         ` Greg KH
2008-03-09  6:33           ` Greg KH
2008-03-09  6:36           ` Balaji Rao
2008-03-09  6:36             ` Balaji Rao
2008-03-09  7:03             ` Greg KH
2008-03-09  7:03               ` Greg KH
2008-03-09  7:21               ` Balaji Rao
2008-03-09  7:21                 ` Balaji Rao
2008-03-09 10:49                 ` Mikael Pettersson
2008-03-09 10:49                   ` Mikael Pettersson
2008-03-10 17:20                   ` Greg KH
2008-03-10 17:20                     ` Greg KH
2008-03-10 15:52                 ` Greg KH
2008-03-10 15:52                   ` Greg KH
2008-03-10 16:05                   ` Balaji Rao
2008-03-10 16:05                     ` Balaji Rao
2008-03-10 17:20                     ` Greg KH
2008-03-10 17:20                       ` Greg KH
2008-03-06 18:34 ` patch kobjects-mark-cleaned-up-kobjects-as-unitialized.patch added to gregkh-2.6 tree gregkh
2008-03-09  4:58 ` patch patches/driver-core/kobjects-mark-cleaned-up-kobjects-as-unitialized.patch " gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.