Re: [PATCH] kobject_set_name_vargs memory leak

From: Eric W. Biederman
Date: Sun Jun 28 2009 - 09:14:22 EST


Kay Sievers <kay.sievers@xxxxxxxx> writes:

> On Sun, Jun 28, 2009 at 14:07, Eric W. Biederman<ebiederm@xxxxxxxxxxxx> wrote:
>
>> But setting a kobject's name several times in a row is a bug. ÂYou
>> need to call kobject_rename if you are going to change the name.
>
> Sure, we can define in that way.
>
>> So how about we fix the driver core not to do that. ÂStop treating fmt
>> as a flag, and make it clear kobject_add should not be passed a name.
>
> Sounds fine to me. You did not try to compile your patch, right? :)

Only the lib/kobject bits...

> block/blk-sysfs.c: In function âblk_register_queueâ:
> block/blk-sysfs.c:436: error: implicit declaration of function âkobj_set_nameâ
>
> drivers/base/driver.c: In function âdriver_add_kobjâ:
> drivers/base/driver.c:149: error: too many arguments to function âkobject_addâ

Ugh I totally missed that one.

> Documentation/kobject.txt would also need an update then.

As for the rules it already seems correct.
But getting the prototype and mentioning kobject_set_name wouldn't
hurt.

Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/