[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1635b9b0-f5c7-b7ed-34d9-bdfc67b2c3f9@huawei.com>
Date: Thu, 20 Oct 2022 11:04:21 +0800
From: shangxiaojing <shangxiaojing@...wei.com>
To: <bongsu.jeon@...sung.com>, <krzysztof.kozlowski@...aro.org>,
<kuba@...nel.org>, <pabeni@...hat.com>, <netdev@...r.kernel.org>
Subject: Re: [PATCH] mm/slub: Fix memory leak in sysfs_slab_add()
On 2022/10/20 11:00, Shang XiaoJing wrote:
> From: Liu Shixin <liushixin2@...wei.com>
>
> temporary scheme
>
> Signed-off-by: Liu Shixin <liushixin2@...wei.com>
> ---
> mm/slub.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index 4b98dff9be8e..3e19320aa162 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -5980,6 +5980,10 @@ static int sysfs_slab_add(struct kmem_cache *s)
> out:
> if (!unmergeable)
> kfree(name);
> + if (err && s->kobj.name) {
> + pr_err("need free kobject.name\n");
> + kfree_const(s->kobj.name);
> + }
> return err;
> out_del_kobj:
> kobject_del(&s->kobj);
Sorry, please ignore, I made a wrong git operation.
Sorry,
--
Shang XiaoJing
Powered by blists - more mailing lists