linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: "Christoph Lameter (Ampere)" <cl@gentwo.org>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	linux-mm@kvack.org
Subject: Re: [RFC PATCH] mm/slab: fix a memory leak on kobject_init_and_add() failure
Date: Tue, 22 Oct 2024 17:12:06 +0200	[thread overview]
Message-ID: <059dead9-51c5-49b9-bbb9-5f3be741c830@suse.cz> (raw)
In-Reply-To: <439eed20-d0c7-8332-2f17-d785321d3310@gentwo.org>

On 10/21/24 18:27, Christoph Lameter (Ampere) wrote:
> 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

To clarify, I only meant the case of boot caches processed for sysfs later.
I don't think we need to start ignoring all sysfs errors.

> fails to create the sysfs pieces then write a warning to syslog but let
> the cache creation succeed.



  reply	other threads:[~2024-10-22 15:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21  9:14 Hyeonggon Yoo
2024-10-21 10:13 ` Vlastimil Babka
2024-10-21 16:27   ` Christoph Lameter (Ampere)
2024-10-22 15:12     ` Vlastimil Babka [this message]
2024-10-22 16:08       ` Christoph Lameter (Ampere)
2024-10-23  9:23         ` Hyeonggon Yoo
2024-10-23  9:28           ` Vlastimil Babka
2024-10-23 17:12             ` Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=059dead9-51c5-49b9-bbb9-5f3be741c830@suse.cz \
    --to=vbabka@suse.cz \
    --cc=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox