From: Mathieu Desnoyers Date: Fri, 24 Nov 2006 18:48:19 +0000 (-0500) Subject: DebugFS : file/directory creation error handling X-Git-Tag: v2.6.20-rc1~22 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=63223a0654c2a473ae64835819b87826cb7415ee;p=linux-2.6-omap-h63xx.git DebugFS : file/directory creation error handling 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 05d1a9c4fb7..d6c5fb53c74 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -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; }