[PATCH 3/5] DebugFS : file/directory creation error handling, 2.6.18

Mathieu Desnoyers
2006-11-23T08:00:12Z

Fix error handling of file and directory creation in DebugFS.

The error path should release the file system because no _remove will be called
for this erroneous creation.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>

--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -198,13 +198,15 @@

pr_debug("debugfs: creating file '%s'\n",name);

- error = simple_pin_fs(&debug_fs_type, &debugfs_mount, &debugfs_mount_count);
+ error = simple_pin_fs(&debug_fs_type, &debugfs_mount,
+ &debugfs_mount_count);
if (error)
goto exit;

error = debugfs_create_by_name(name, mode, parent, &dentry);
if (error) {
dentry = NULL;
+ simple_release_fs(&debugfs_mount, &debugfs_mount_count);
goto exit;