Received: by 2002:aa6:da0e:0:b029:115:a171:fe4c with SMTP id z14csp1261427lkb; Wed, 7 Jul 2021 02:50:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0k0fjjH3cmdE/a+PZD9Ydi34F4ewjudkaw6YI+dUZVowmrn8QeCA7yNejGqurVtJgYRTG X-Received: by 2002:a05:6402:458:: with SMTP id p24mr28481540edw.142.1625651420032; Wed, 07 Jul 2021 02:50:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625651420; cv=none; d=google.com; s=arc-20160816; b=E5gj/dNqCxl4nIYwzUNPZNNr5w7xOh78/ulJdsnROiITxaKG2lAGInFoo1u0seLJ7T GuqZcgI4r/yzIEst2RHYBLE+2hzepPssYgceoFXDLZYRy+wugPZ+etlgbZpQx1gy7xLp 0bUXoZRQXVFonB0KMpNndbdN9jYdbjsuRYFLIKT1JRlKLfrveorD7Dh9Y5VOHicC0Hj1 5/4LotnDckbRApI7lPk9w/yFrgaKjFCnvEfItpaB+XKytHZpuqO9gPNgjSf5hssdVWdx 8nnYA0dcnFVkWgsnusWPSQL4+tU4mVjjt6pSNxZcuhS6Pe0gfpKVdoDGIiEf/rugD675 dCyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=Jm/J1o+TQpzcHBhxjA/suPmsl2pJmPGx91gwOJgbshQ=; b=cnjZk/GtYPjZMl55kGHsgDiJjvmXLXhD0PxRR7Xn0kPkQIP3/gSINmsSGk2beNr3r7 csKgsdooHxpigHEIdW9MlfZKWaOEImufcbhdv79ukOCk+Ahw6NaUQjQPDSootD34cAmg a8fKCvaYo5EmZUooKOBWeKo6AJ59HgOaUYrb4dpYg3QaT+o64JjYtgfLHzhf4aR66n6a 0Nz0zjiWMYEDl+AJJjtRxyVV/19Xxh+b9ysRCmDjPFcxgu+pvpN7LvUmF56qpnmFQIB7 9LqtohuJumD/NZQCJO58bhg568NQjuZCRH5pC0WWdpDxkHrsdgFIbLj1XQW0gQ4nLfC9 kpUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SnViRNeG; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 5si17794449ejh.535.2021.07.07.02.49.57; Wed, 07 Jul 2021 02:50:20 -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=@gmail.com header.s=20161025 header.b=SnViRNeG; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231423AbhGGJvY (ORCPT + 99 others); Wed, 7 Jul 2021 05:51:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231421AbhGGJvW (ORCPT ); Wed, 7 Jul 2021 05:51:22 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78033C06175F; Wed, 7 Jul 2021 02:48:41 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id f20so1637357pfa.1; Wed, 07 Jul 2021 02:48:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Jm/J1o+TQpzcHBhxjA/suPmsl2pJmPGx91gwOJgbshQ=; b=SnViRNeGD8tPxOTvIR/wc5IFDeE9SYmRwqPj+In9bmtPibgokbUlvYrXcxnslfFu1w NyZ+anSqC5rW0YYwF5IXRm1AVD+Uoq2c3DFVlSgXzu7bmSE3LGDG7MjVJAQ6lL/j0FqA uT6eDsjlB+ucP+nBjr4H5XdQfO2dut2uTlHyL1TIZOPvDcvTu7Pq6RXZr+G+r062SVPd VPG6HfnSZzgxUPSmPRrE83sloro8UBVHYV7/mXC/fRMWqTDuXn2q4xgsHZiMeRS8YeNS Rz1p4ytOfbN8Fd38Ces8T4UleMd3hEgYPs+WLYp+qYHDc7gnEv0uz5bOsbtslX006L87 6JxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Jm/J1o+TQpzcHBhxjA/suPmsl2pJmPGx91gwOJgbshQ=; b=kXLtsw+zBEQCS5XVE68VMLlK/8K6WP6dAhNnrPMpN5fJwhI6nimIdDdxK0CvFQln2l zlqAqBlS8YxFNUCQriNiyfW8dVwPce26Xwt6RC1uS98bbl8r59JQdwqcxULhpm/HZTj4 0Y0rdMVShQVZ1sTQUpP3lGERfFXJUPmHnEyPkU2ZAOLE1gX1exX+pVnnF+QgBPhZ9nXt h5oNODrjD88RNixiKVYSlEso3Un22Y5ATvdF7FrMFKOrDEjQ1SyvM462xgcxjUIQRe8D +iVy6rD0XVxYCJpPG7gcfIs8XttaS+mhzGvsWy4Vbrm9JZ/TfwtfaXLqoQ39lnc2H/NJ BX8g== X-Gm-Message-State: AOAM533tXqpW68T1U8wkfgI2mVjxWRiLjtWkmV6qN0yO3O/Wx7EeMhUA PNJ7fQzXC9i73PpY2/QjGPE= X-Received: by 2002:a63:2b91:: with SMTP id r139mr25048297pgr.242.1625651321000; Wed, 07 Jul 2021 02:48:41 -0700 (PDT) Received: from carrot.localdomain (i60-35-90-140.s42.a014.ap.plala.or.jp. [60.35.90.140]) by smtp.gmail.com with ESMTPSA id gd19sm80137pjb.38.2021.07.07.02.48.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jul 2021 02:48:39 -0700 (PDT) From: Ryusuke Konishi To: Andrew Morton Cc: linux-nilfs , LKML Subject: [PATCH 4/6] nilfs2: fix memory leak in nilfs_sysfs_delete_##name##_group Date: Wed, 7 Jul 2021 18:48:24 +0900 Message-Id: <1625651306-10829-5-git-send-email-konishi.ryusuke@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1625651306-10829-1-git-send-email-konishi.ryusuke@gmail.com> References: <1625651306-10829-1-git-send-email-konishi.ryusuke@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nanyong Sun 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 Signed-off-by: Nanyong Sun Signed-off-by: Ryusuke Konishi --- 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 5dc468ff5903..34893a57a7b9 100644 --- a/fs/nilfs2/sysfs.c +++ b/fs/nilfs2/sysfs.c @@ -97,7 +97,7 @@ } \ 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); \ } /************************************************************************ -- 1.8.3.1