Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1491567pxb; Fri, 24 Sep 2021 05:54:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMSbAE993nWJKT+HUFsLBflPxSmSTQBw/Rj98ExIOX3u+yJWp4lVHm4P8pFnSA6bSUCpto X-Received: by 2002:a05:6e02:bc4:: with SMTP id c4mr8124991ilu.129.1632488053714; Fri, 24 Sep 2021 05:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632488053; cv=none; d=google.com; s=arc-20160816; b=mmm9hURSPHPgY8CoFj7WG21Z4AUkzLNRbmfi2YfIz9jS0CfwMdlXOuRQZmu8R/SIOK oVByXU8JX/03kZ+e3rFrtg1TGs5OPRWKzyFf9ct2K2E2Hu9FhBDcIZKAcjjEAeajla1e oBYRi5143e68gR8yarix6cF8e9IPEl0LDqvCajPlF9iTdop8TgEq8jQUf0DmD/UO1tu4 qo8Llxyj2wDAXD5RTMo8N+hCErPm7iFnS0MIVkYG9r4JbMrQbly9bC6VX6Xlnzc8z964 NXk24X0BD0LHaRisY+B52vgYnlCxODR7Dlp4uMGEGW3SmoohveLHyjXDOtxryCh+UCWY G5UQ== 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=7F30blan+6I2x7CAZRLv0dON9Mpee9LLI7PnQAWE5Vo=; b=bydWSPAUb85Sbx2PI0/ixYrITajHZHpGm3KmOONklU1LTX/o2ETkA3KWq9Q7xiQTKe qj3dK99LUqQyUN/0m1qVz4WA9m80LqpWsNz6VtPPXC17GHD9GT3yebCk9273C+4bHnBI dYUeQJ6R21VivqOvQ8usBui+l0RVO93pSsaqHAJFq4f9pwlBWH4KJJnFeO5oyi6XJC4P CqZeeZTEKJyP0jrOlU9+L4HzG+8ATadQL7ZgAxA4KmzFCehlX3b7u8g1nOEaitxa2YNJ aKuMwRFwJmsEC7GSgJctd9PK02An2Mg6CKezlUhxjIRhX2EMsrbOm7ASDNeiFyW0WZhU nvmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=idxqAm27; 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 d16si11196044ile.92.2021.09.24.05.53.58; Fri, 24 Sep 2021 05:54:13 -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=idxqAm27; 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 S1345013AbhIXMx7 (ORCPT + 99 others); Fri, 24 Sep 2021 08:53:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:45816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344322AbhIXMwT (ORCPT ); Fri, 24 Sep 2021 08:52:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 99A3761251; Fri, 24 Sep 2021 12:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632487768; bh=g9FEh5ZXYGH3U8zMTyzYyXgHJSr3oivYiIJZrRMuo7Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=idxqAm27Z/MyKOLrFX2yyiMiVFKwJDT7DucklcDc5Kb4nBUBk65wlFFqw+5Rs3uwK F9e4Nb+NjiTpxzsmbWKCd2lnFyHNnQ3laUb4vdMtYV629mr3ThINmLFtu/vL0yOTCQ ncGhF9R/dVc53/HjXqPl2PsQ8p7QvphQ59JJ6d+Q= 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 29/34] nilfs2: fix memory leak in nilfs_sysfs_delete_snapshot_group Date: Fri, 24 Sep 2021 14:44:23 +0200 Message-Id: <20210924124330.919219321@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 17243e1c3072b8417a5ebfc53065d0a87af7ca77 ] 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 Link: https://lkml.kernel.org/r/1625651306-10829-7-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 6c92ac314b06..28a2db3b1787 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); } /************************************************************************ -- 2.33.0