Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758654AbZD1Qia (ORCPT ); Tue, 28 Apr 2009 12:38:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753410AbZD1QiT (ORCPT ); Tue, 28 Apr 2009 12:38:19 -0400 Received: from hera.kernel.org ([140.211.167.34]:32942 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754778AbZD1QiT (ORCPT ); Tue, 28 Apr 2009 12:38:19 -0400 Message-ID: <49F7308A.2010804@kernel.org> Date: Tue, 28 Apr 2009 09:36:26 -0700 From: Yinghai Lu User-Agent: Thunderbird 2.0.0.19 (X11/20081227) MIME-Version: 1.0 To: Kay Sievers CC: Greg KH , Ingo Molnar , Linus Torvalds , Jesse Barnes , Andrew Morton , "H. Peter Anvin" , Thomas Gleixner , "linux-kernel@vger.kernel.org" , linux-pci@vger.kernel.org Subject: Re: [RFC PATCH] use dev_set_name(,NULL) to prevent leaking References: <20090418192314.GA22107@suse.de> <20090418203718.GD30144@elte.hu> <49EA4EB9.2030307@kernel.org> <49F6B1E6.7050008@kernel.org> <49F6B350.9080703@kernel.org> <49F71EF6.3050102@kernel.org> <49F72205.7030306@kernel.org> <20090428153906.GA8896@suse.de> <49F7260F.8030405@kernel.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 761 Lines: 20 Kay Sievers wrote: > On Tue, Apr 28, 2009 at 17:51, Yinghai Lu wrote: > >> before device_register==>device_initialize is called, kobj->ref is still 0. >> >> will get warn from >> if (!kobj->state_initialized) > > Initialize the device before you do anything with it. And call _put() > any time to get rid of ressources, which might have been allocated > before registering. need to replace device_register with device_add and call device_initialize before device_set_name? YH -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/