Re: [RFC PATCH] mm/slab: fix a memory leak on kobject_init_and_add() failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 21 Oct 2024, Vlastimil Babka wrote:

> I think the comment "If this function returns an error, kobject_put() must
> be called" means that *if* you want to destroy it due to the failure, you
> must use kobject_put() and not e.g. kfree(). But IMHO it doesn't mean you
> must destroy it because of the kobject_add() failure.

Right. The simplest solution is to see the sysfs stuff as optional. If it
fails to create the sysfs pieces then write a warning to syslog but let
the cache creation succeed.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux