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.