From compudj@krystal.dyndns.org Fri Nov 24 10:48:22 2006 Date: Fri, 24 Nov 2006 13:48:19 -0500 From: Mathieu Desnoyers To: Greg KH Cc: ltt-dev@shafik.org, linux-kernel@vger.kernel.org Subject: DebugFS : file/directory creation error handling Message-ID: <20061124184818.GC8952@Krystal> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --- fs/debugfs/inode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- gregkh-2.6.orig/fs/debugfs/inode.c +++ gregkh-2.6/fs/debugfs/inode.c @@ -206,13 +206,15 @@ struct dentry *debugfs_create_file(const 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; }