Received: by 2002:aa6:da0e:0:b029:115:a171:fe4c with SMTP id z14csp1262208lkb; Wed, 7 Jul 2021 02:51:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJpJlyi0AwhzV7ZrwUNIig1cO7eVg1DOeyHbwWeFLoMXz/GzeDMQTzTwTjHot6ya0IcC1O X-Received: by 2002:a50:d64a:: with SMTP id c10mr29656843edj.199.1625651499157; Wed, 07 Jul 2021 02:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625651499; cv=none; d=google.com; s=arc-20160816; b=DHH6glgiG5ISmq85Ev1AVjZvUUkb1oxVawp0uXnfODQH0c3j05QexQWJywHON63cNt lI+838Iz3mZVfuJc984Qw4D61dy5uxczxGUoZLfaREu14Tc6WZ+VQSj68iVDFxP6H+sD 9sqLsyY60NSR+MhrgPsRgtbXc80BXAp5nR//2x1BycFPWrlEIKFNYxMCDhIK1amuZGkW sWcgbSmbkycEK76J0JWI+96OIWlxoVpcxx5CC7D9OOeIhafSrSGe2tB0IfRIeviWdDz/ kGdEQUhD11gL/yRvwKqhm2jSCeARccwSpybEBWnHq55Tg5iCIKrHXHCRl2dyiMfo0p0B YyQg== 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=e2xjwDG/oZGI2BDWWVUZ80C0oSrUvvIT1iby/SeB9H8=; b=jJSKkoVHeKmHhylaaBH4oKYShWOCwjDeJxPIY0vs6HqcDC1EP/R4lQXSfDkMkYXNNl GHB42ai99vIKNiQ8wJPcWuhKsxgi6WrRh0odUCdK56zR7HLRGkHfMRWWWiKQJHEnuJ9f pD2671TkT+mkOrumgOvACNzMu3cMQpCFZllBrBdBm231fj3jzWMLJpBDgG0lDGnQi4VJ ceSJIMweNe3ogG6ls6owe8uWcaVubG1b+kpw2Lgv7pVcrowMzeNH8ES9c96XcnNa3SOf cjpSAxmXaqLHxAyKZMoRtXm3DR7q8BrcjHsjisqp4oARVAj8F0ywjqUsM3FgqxYBJ8rn Is1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JhvyPBxe; 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 v30si16178005ejk.99.2021.07.07.02.51.16; Wed, 07 Jul 2021 02:51:39 -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=JhvyPBxe; 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 S231454AbhGGJvb (ORCPT + 99 others); Wed, 7 Jul 2021 05:51:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231470AbhGGJv1 (ORCPT ); Wed, 7 Jul 2021 05:51:27 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 950C9C061574; Wed, 7 Jul 2021 02:48:46 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id y17so1619326pgf.12; Wed, 07 Jul 2021 02:48:46 -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=e2xjwDG/oZGI2BDWWVUZ80C0oSrUvvIT1iby/SeB9H8=; b=JhvyPBxeQDK0AX7lHIYF3EBROFvkLgtaCEPz9WylHwpHVc9kbRdh7rqGKjqL/eKDf2 sYk1Qj14BNzFx2wJSWs35fR5G16VsNcaAMrWL6AX8Irn/nTKm6JkH1za1WNlf5BsuA9h 8Iz9jAwS75U8loxeXMPhYjKTeJRBsBo/PWJDoz2Wz0YyGDPx08DZfWWFR3bsI5c01gvE CHKHR15hjJXlV/laOcvLng8piA9Nswly05jShlaOJKaIQ8x5qfyqFid+Rmnt6fTycTWR T8OYE25BrFYEI6HzzzDeMm4/se9UDIRt1kUPmEMFygVDM7wfGcmD05iFE+fVXkFQWj7i pPAQ== 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=e2xjwDG/oZGI2BDWWVUZ80C0oSrUvvIT1iby/SeB9H8=; b=texzqHUQ71q9bxT6Q+rJXMk4oH2d/BvekfxJ5oug6WjC2sB53utFXCqBMGhPjSd2h/ Kw34Beipl9tkEfhU1FemLIks7lk0jW2Zom3IQ+mLz4L/Hhqgxegii/NyvIr50wz1KNDb hXrupFSu1fK+ThSaS3hkt5JBPPgn0C/CALKrYxL+XbrvKiHLm+IUwFJ0Nbk7D9nApoVK 9in1dsNuh1c06Zuc2Bo6hRbTA9nYg8plELKp5XPDp2wPsxj8uvosun2rDBTA3cVpM1It bVhChnd8x/4LQTLKif4TxAb55ozIjVdpal5kv+25IvGDbuNwYn8vp+fDXmts1n28kBAn YdDg== X-Gm-Message-State: AOAM5329jjtjCcdTM4rGxCMrE4Ww7Wmx9sSS2ryjpxq2ML6/9XE3ubu/ 5xBnclVuHGgBWOFdJlS8GMA= X-Received: by 2002:a65:434c:: with SMTP id k12mr25259494pgq.17.1625651326178; Wed, 07 Jul 2021 02:48:46 -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.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jul 2021 02:48:44 -0700 (PDT) From: Ryusuke Konishi To: Andrew Morton Cc: linux-nilfs , LKML Subject: [PATCH 6/6] nilfs2: fix memory leak in nilfs_sysfs_delete_snapshot_group Date: Wed, 7 Jul 2021 18:48:26 +0900 Message-Id: <1625651306-10829-7-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 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-7-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 44b9ad70a564..57afd06db62d 100644 --- a/fs/nilfs2/sysfs.c +++ b/fs/nilfs2/sysfs.c @@ -215,7 +215,7 @@ int nilfs_sysfs_create_snapshot_group(struct nilfs_root *root) void nilfs_sysfs_delete_snapshot_group(struct nilfs_root *root) { - kobject_del(&root->snapshot_kobj); + kobject_put(&root->snapshot_kobj); } /************************************************************************ -- 1.8.3.1