[PATCH] Free the temporary vfsmount created in bdev_cache_init()

From: Catalin Marinas
Date: Wed Apr 01 2009 - 07:09:29 EST


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@xxxxxxx>
Acked-by: Cheng Renquan <crquan@xxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

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);
}

/*

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/