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,
if ( error && error != -ENOENT ) {
EXIT;
unlock_kernel();
putname(tmp);
return error;
}
if (error == -ENOENT)
......@@ -2195,7 +2196,7 @@ int lento_iopen(const char *name, ino_t ino, unsigned int generation,
fd = get_unused_fd();
if (fd < 0) {
EXIT;
goto cleanup_dput;
goto exit;
}
{
......@@ -2205,10 +2206,9 @@ int lento_iopen(const char *name, ino_t ino, unsigned int generation,
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 @@ int lento_iopen(const char *name, ino_t ino, unsigned int generation,
path_release(&nd);
putname(tmp);
return fd;
cleanup_dput:
putname(&nd);
goto exit;
}
#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