Skip to contentSkip to conversation

Free the temporary vfsmount created in bdev_cache_init()

PATCH New Catalin Marinas 1 participant 1 message Jan 14, 2009 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Free the temporary vfsmount created in bdev_cache_init()

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.

---
 fs/block_dev.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
fs/block_dev.c +1 -0
index b3c1eff..5124756 100644
@@ -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);
 }
 
 /*