public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Free the temporary vfsmount created in bdev_cache_init()
@ 2009-04-01 11:07 Catalin Marinas
  2009-04-01 11:49 ` Al Viro
  0 siblings, 1 reply; 4+ messages in thread
From: Catalin Marinas @ 2009-04-01 11:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Cheng Renquan

The vfsmount structure allocated in this function (the bd_mnt local
variable) is only used to obtain the blockdev_superblock and there are
no other references to it. This structure can be safely freed (and
prevent kmemleak from reporting it).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Cheng Renquan <crquan@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---

This patch was submitted and acked some time ago but I don't think it
made it into the kernel. Here it is again. Thanks.

 fs/block_dev.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 8c3c689..e7a332f 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -492,6 +492,7 @@ void __init bdev_cache_init(void)
 	if (IS_ERR(bd_mnt))
 		panic("Cannot create bdev pseudo-fs");
 	blockdev_superblock = bd_mnt->mnt_sb;	/* For writeback */
+	free_vfsmnt(bd_mnt);
 }
 
 /*


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] Free the temporary vfsmount created in bdev_cache_init()
@ 2009-01-14 11:40 Catalin Marinas
  0 siblings, 0 replies; 4+ messages in thread
From: Catalin Marinas @ 2009-01-14 11:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Cheng Renquan

The vfsmount structure allocated in this function (the bd_mnt local
variable) is only used to obtain the blockdev_superblock and there are
no other references to it. This structure can be safely freed.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Cheng Renquan <crquan@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 fs/block_dev.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index b3c1eff..5124756 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -346,6 +346,7 @@ void __init bdev_cache_init(void)
 	if (IS_ERR(bd_mnt))
 		panic("Cannot create bdev pseudo-fs");
 	blockdev_superblock = bd_mnt->mnt_sb;	/* For writeback */
+	free_vfsmnt(bd_mnt);
 }
 
 /*


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-01 12:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-01 11:07 [PATCH] Free the temporary vfsmount created in bdev_cache_init() Catalin Marinas
2009-04-01 11:49 ` Al Viro
2009-04-01 12:12   ` Catalin Marinas
  -- strict thread matches above, loose matches on Subject: below --
2009-01-14 11:40 Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox