- Don't leak a pathname ref on error - Don't do putname() on a nameidata. --- 25-akpm/fs/intermezzo/vfs.c | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-) diff -puN fs/intermezzo/vfs.c~intermezzo-leak-fixes fs/intermezzo/vfs.c --- 25/fs/intermezzo/vfs.c~intermezzo-leak-fixes 2004-04-04 16:43:58.499923864 -0700 +++ 25-akpm/fs/intermezzo/vfs.c 2004-04-04 16:48:54.675898272 -0700 @@ -2149,6 +2149,7 @@ again: /* look the named file or a pare if ( error && error != -ENOENT ) { EXIT; unlock_kernel(); + putname(tmp); return error; } if (error == -ENOENT) @@ -2195,7 +2196,7 @@ again: /* look the named file or a pare fd = get_unused_fd(); if (fd < 0) { EXIT; - goto cleanup_dput; + goto exit; } { @@ -2205,10 +2206,9 @@ again: /* look the named file or a pare if (IS_ERR(f)) { put_unused_fd(fd); fd = error; - EXIT; - goto cleanup_dput; - } - fd_install(fd, f); + } else { + fd_install(fd, f); + } } /* end of code that might be replaced by open_dentry */ @@ -2218,10 +2218,6 @@ exit: path_release(&nd); putname(tmp); return fd; - -cleanup_dput: - putname(&nd); - goto exit; } #ifdef CONFIG_FS_EXT_ATTR _