From: Balaji Rao Subject: [PATCH] Mark kobjects as unitialized Date: Thu, 6 Mar 2008 22:23:18 +0530 Message-ID: <200803062223.18857.balajirrao@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org To: gregkh@suse.de Return-path: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org 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 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 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/