Explorar el Código

leak in hostfs_unlink()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Al Viro hace 15 años
padre
commit
f8d7e1877e
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      fs/hostfs/hostfs_kern.c

+ 3 - 2
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;