leak in hostfs_unlink()
Al Viro [Mon, 7 Jun 2010 03:19:04 +0000 (23:19 -0400)]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

fs/hostfs/hostfs_kern.c

index 79783a0..8130ce9 100644 (file)
@@ -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;