Skip to content

Commit

Permalink
DebugFS : file/directory creation error handling
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Mathieu Desnoyers authored and Greg Kroah-Hartman committed Dec 13, 2006
1 parent bafb232 commit 63223a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/debugfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,15 @@ struct dentry *debugfs_create_file(const char *name, mode_t mode,

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

Expand Down

0 comments on commit 63223a0

Please sign in to comment.