Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1745030pxb; Fri, 24 Sep 2021 10:52:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1yCI0XmGKv+Rw73veT+5HD2cilEVcoTE8hAJy7PznntguTmyOsu12TaxsDxBObFMHpRny X-Received: by 2002:a05:6602:3311:: with SMTP id b17mr150338ioz.47.1632505923525; Fri, 24 Sep 2021 10:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632505923; cv=none; d=google.com; s=arc-20160816; b=SKyYJSov1XQC9f53S++hYrz8nYjhYgUpbtTb0nLh3CeB88umu33tFz0g0w+TXgReOh s7Ndu48GJyiUFQ7IxbmQdoknFDozBdbMcBHRz9AgUGLirK/D2EJZqprMrOAF16sdbWy/ Nqk91WP0tlyuei3tc0WBEiVAnkIEylMMRA0yLDV4rDdLX32ekYUAg2XjpuI5+JyMhfET o3qo4G7DsBQRdBX0zhDCjN91s+oO2s/C9F5Dctz4iI/lJAw+ddYgL3GVll0Hym+RnMUB ZUSja8Arf4v7GayFC69mfNdJsHbn9E4vfZtzL2Wr2hZIlR7eW3wKivlnrHWT2+/+OPHY 3eaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KiNDyIGDfGW/iGeU3h+rKQxOClNNiLoJUIDkbEPqP0w=; b=ZfPjmzG752uGojwX5oXaZzkx4aPtY5pilSx5S0iNl5hR9uW+EO0sG8BNmRqHFXrz/r dPGHa75PCjIwPg3jDqH2jR33sE4nlK+e1aF68wHNZAVKkiKsBKYX3qo1JHLZD7hqTKHV dXcUKB24/xz0LBtnjywanA6z4l1zy0oslZZ7GSV1ofivPzHoWLeRHSP2gDXwK+Uio5qV nCUWddEb5Ufm3ZhattUGX6g1NxYDM9zFSVyAH+KBSwzj28Wl+LLXBI80/HLvrlkSw83y nU4OXpHAOoLEZAS/5pP3WyXAHMF6scOPN3ERBK85pMxDLJNJIa7aT0vbkHle1AhT0y+m KuXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LTIqqhYi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d6si11144031ilv.154.2021.09.24.10.51.44; Fri, 24 Sep 2021 10:52:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LTIqqhYi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344997AbhIXMxv (ORCPT + 99 others); Fri, 24 Sep 2021 08:53:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:44798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344303AbhIXMwE (ORCPT ); Fri, 24 Sep 2021 08:52:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 583E06135D; Fri, 24 Sep 2021 12:49:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632487762; bh=xiyZqlbaRpJ8num4MXbLXtQ5Tpeb4qTgDghpzXiLJwc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LTIqqhYiqJjlEeXcCrbrm4jM2lOv8Q9pR8MjoGO4audOkZQcEbu5xuCbF1Tzp7bbj qGZss7yBv+aECj9GVS+VlW9BMm3VEIB43bcUg7eoxYx6t7UTCZGcaqDUXQwx7Xw9DJ ELLbgLpCQwRwxXf9JFRzXpl37T0k05ANC5CqSPEo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nanyong Sun , Ryusuke Konishi , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 4.19 27/34] nilfs2: fix memory leak in nilfs_sysfs_delete_##name##_group Date: Fri, 24 Sep 2021 14:44:21 +0200 Message-Id: <20210924124330.847496670@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210924124329.965218583@linuxfoundation.org> References: <20210924124329.965218583@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nanyong Sun [ Upstream commit a3e181259ddd61fd378390977a1e4e2316853afa ] The kobject_put() should be used to cleanup the memory associated with the kobject instead of kobject_del. See the section "Kobject removal" of "Documentation/core-api/kobject.rst". Link: https://lkml.kernel.org/r/20210629022556.3985106-5-sunnanyong@huawei.com Link: https://lkml.kernel.org/r/1625651306-10829-5-git-send-email-konishi.ryusuke@gmail.com Signed-off-by: Nanyong Sun Signed-off-by: Ryusuke Konishi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- fs/nilfs2/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nilfs2/sysfs.c b/fs/nilfs2/sysfs.c index 31d640a87b59..195f42192a15 100644 --- a/fs/nilfs2/sysfs.c +++ b/fs/nilfs2/sysfs.c @@ -97,7 +97,7 @@ static int nilfs_sysfs_create_##name##_group(struct the_nilfs *nilfs) \ } \ static void nilfs_sysfs_delete_##name##_group(struct the_nilfs *nilfs) \ { \ - kobject_del(&nilfs->ns_##parent_name##_subgroups->sg_##name##_kobj); \ + kobject_put(&nilfs->ns_##parent_name##_subgroups->sg_##name##_kobj); \ } /************************************************************************ -- 2.33.0