Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3997398pxv; Mon, 28 Jun 2021 18:56:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCRe6qEKY50k95AcllP97D8Q2WitRSjxx/9/zlw85Ud+6QeUSegQaAEH2NW4q4i6qrx9It X-Received: by 2002:a5d:8b8b:: with SMTP id p11mr1938790iol.77.1624931764391; Mon, 28 Jun 2021 18:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624931764; cv=none; d=google.com; s=arc-20160816; b=Z6gg/A359H1OxAyFheaqqJnujpxYxNU36aqZ5BgBargmg6r1j9L/NYSGXIQBJg6CBi XGLA0dZvzfImzndpaDmi7CLU79+eaM6DE0XBLSgiIcJmu452AhIn64w+92yUEizUO+vR dCcIHYQHaHTKv/Cly4/8Kf1QHSpWNVtjW8Y63UE1gwRbfTCoWFSJyelh18mVBRzFVOKK W1xBGgepVTwYVOb6ISnA0w1gdQW5TKEmYmRtmJ6YZPmOGpIFnEVY7xKe757MOErShusX Q1ZkGjwBcu1YBkFiHkBvcIgfpYqDhtCqBo5pFPnd5ac888OQA2metPCf1cgW+0I31R0s UiuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=cWLSSkmws9UROekg41IgRuCpnuzdSJMojWcMeDglbCQ=; b=nzBqzShwD+vvUXCeYGnd6gVOnlgJQX/1s9odI25NQ3YVI75/mnW0jMaxRjaWRQAbfi VEOW2vVuAcQYYzp+b3NiTbvFkzU4aQzc4D1itBriHnhcVYp/21EE8PJNQRzt342O11yp KdMFM94FZtFmESLyyL+NWOGoDZHGPplDQBKImQXPXSjYeouZZ/WeggI76/C+0sP2B/1c kuyyHZYCltUhil49DLkQq7iAitpmeREU3QOGGI1l2ydi46FVe87z0l5otZKpIDsejh7O 1RBZEp/m6Wi1FW9n48tLLE8ffaWq5b4yIsowIVXBOUGylzGBYEciEBVk6idE3oI/1BFV aCaA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i1si19598986iov.7.2021.06.28.18.55.52; Mon, 28 Jun 2021 18:56:04 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231750AbhF2B5V (ORCPT + 99 others); Mon, 28 Jun 2021 21:57:21 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:6020 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231263AbhF2B5E (ORCPT ); Mon, 28 Jun 2021 21:57:04 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4GDS7z0SMNzXmK8; Tue, 29 Jun 2021 09:49:19 +0800 (CST) Received: from dggpemm000001.china.huawei.com (7.185.36.245) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 29 Jun 2021 09:54:31 +0800 Received: from huawei.com (10.175.113.32) by dggpemm000001.china.huawei.com (7.185.36.245) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 29 Jun 2021 09:54:30 +0800 From: Nanyong Sun To: CC: , , , Subject: [PATCH 6/6] nilfs2: fix memory leak in nilfs_sysfs_delete_snapshot_group Date: Tue, 29 Jun 2021 10:25:56 +0800 Message-ID: <20210629022556.3985106-7-sunnanyong@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 In-Reply-To: <20210629022556.3985106-1-sunnanyong@huawei.com> References: <20210629022556.3985106-1-sunnanyong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm000001.china.huawei.com (7.185.36.245) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kobject_put() should be used to cleanup the memory associated with the kobject insead of kobject_del(). See the section "Kobject removal" of "Documentation/core-api/kobject.rst". Signed-off-by: Nanyong Sun --- 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 5ba87573ad3b..62f8a7ac19c8 100644 --- a/fs/nilfs2/sysfs.c +++ b/fs/nilfs2/sysfs.c @@ -202,7 +202,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); } /************************************************************************ -- 2.18.0.huawei.25