Commit 7804ee5a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] intermezzo leak fixes

- Don't leak a pathname ref on error

- Don't do putname() on a nameidata.
parent 8ae81ff5
...@@ -2149,6 +2149,7 @@ int lento_iopen(const char *name, ino_t ino, unsigned int generation, ...@@ -2149,6 +2149,7 @@ int lento_iopen(const char *name, ino_t ino, unsigned int generation,
if ( error && error != -ENOENT ) { if ( error && error != -ENOENT ) {
EXIT; EXIT;
unlock_kernel(); unlock_kernel();
putname(tmp);
return error; return error;
} }
if (error == -ENOENT) if (error == -ENOENT)
...@@ -2195,7 +2196,7 @@ int lento_iopen(const char *name, ino_t ino, unsigned int generation, ...@@ -2195,7 +2196,7 @@ int lento_iopen(const char *name, ino_t ino, unsigned int generation,
fd = get_unused_fd(); fd = get_unused_fd();
if (fd < 0) { if (fd < 0) {
EXIT; EXIT;
goto cleanup_dput; goto exit;
} }
{ {
...@@ -2205,10 +2206,9 @@ int lento_iopen(const char *name, ino_t ino, unsigned int generation, ...@@ -2205,10 +2206,9 @@ int lento_iopen(const char *name, ino_t ino, unsigned int generation,
if (IS_ERR(f)) { if (IS_ERR(f)) {
put_unused_fd(fd); put_unused_fd(fd);
fd = error; fd = error;
EXIT; } else {
goto cleanup_dput; fd_install(fd, f);
} }
fd_install(fd, f);
} }
/* end of code that might be replaced by open_dentry */ /* end of code that might be replaced by open_dentry */
...@@ -2218,10 +2218,6 @@ int lento_iopen(const char *name, ino_t ino, unsigned int generation, ...@@ -2218,10 +2218,6 @@ int lento_iopen(const char *name, ino_t ino, unsigned int generation,
path_release(&nd); path_release(&nd);
putname(tmp); putname(tmp);
return fd; return fd;
cleanup_dput:
putname(&nd);
goto exit;
} }
#ifdef CONFIG_FS_EXT_ATTR #ifdef CONFIG_FS_EXT_ATTR
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment