Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762483AbZD1P4h (ORCPT ); Tue, 28 Apr 2009 11:56:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758703AbZD1P41 (ORCPT ); Tue, 28 Apr 2009 11:56:27 -0400 Received: from mail-ew0-f176.google.com ([209.85.219.176]:59070 "EHLO mail-ew0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753756AbZD1P40 convert rfc822-to-8bit (ORCPT ); Tue, 28 Apr 2009 11:56:26 -0400 MIME-Version: 1.0 In-Reply-To: <49F7260F.8030405@kernel.org> 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> From: Kay Sievers Date: Tue, 28 Apr 2009 17:56:05 +0200 Message-ID: Subject: Re: [RFC PATCH] use dev_set_name(,NULL) to prevent leaking To: Yinghai Lu 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 643 Lines: 18 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. Thanks, Kay -- 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/