summaryrefslogtreecommitdiff
path: root/fs/hostfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-06-06 23:19:04 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-09 16:48:14 -0400
commitf8d7e1877e5121841bc9a4d284a04dbc13f45bea (patch)
tree32e48fce4398797ed52de54131362a3413924cb2 /fs/hostfs
parente9193059b1b3733695d5b80e667778311695aa73 (diff)
downloadlwn-f8d7e1877e5121841bc9a4d284a04dbc13f45bea.tar.gz
lwn-f8d7e1877e5121841bc9a4d284a04dbc13f45bea.zip
leak in hostfs_unlink()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hostfs')
-rw-r--r--fs/hostfs/hostfs_kern.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index 79783a0b2f4d..8130ce93a06a 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -622,11 +622,12 @@ int hostfs_unlink(struct inode *ino, struct dentry *dentry)
char *file;
int err;
- if ((file = dentry_name(dentry)) == NULL)
- return -ENOMEM;
if (append)
return -EPERM;
+ if ((file = dentry_name(dentry)) == NULL)
+ return -ENOMEM;
+
err = unlink_file(file);
__putname(file);
return err;