[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ac3eb2510904280915m472e7e56w8c0331acfd9f083f@mail.gmail.com>
Date: Tue, 28 Apr 2009 18:15:15 +0200
From: Kay Sievers <kay.sievers@...y.org>
To: Yinghai Lu <yinghai@...nel.org>
Cc: Greg KH <gregkh@...e.de>, Ingo Molnar <mingo@...e.hu>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jesse Barnes <jbarnes@...tuousgeek.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linux-pci@...r.kernel.org
Subject: Re: [RFC PATCH] use dev_set_name(,NULL) to prevent leaking
On Tue, Apr 28, 2009 at 18:08, Yinghai Lu <yinghai@...nel.org> wrote:
> Kay Sievers wrote:
>> On Tue, Apr 28, 2009 at 17:51, Yinghai Lu <yinghai@...nel.org> 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.
> so you mean don't call dev_set_name before device_register and let device_register or device_add take name param?
No. I meant:
device_initialize()
call put_device() any time you want to get rid of ressources of the device
device_set_name()
call put_device() any time you want to get rid of ressources of the device
device_register()
...
Kay
--
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