Skip to content

Commit d1ca869

Browse files
author
Al Viro
committed
spufs: fix a leak on spufs_new_file() failure
It's called from spufs_fill_dir(), and caller of that will do spufs_rmdir() in case of failure. That does remove everything we'd managed to create, but... the problem dentry is still negative. IOW, it needs to be explicitly dropped. Fixes: 3f51dd9 "[PATCH] spufs: fix spufs_fill_dir error path" Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 80e54e8 commit d1ca869

File tree

1 file changed

+3
-1
lines changed
  • arch/powerpc/platforms/cell/spufs

1 file changed

+3
-1
lines changed

arch/powerpc/platforms/cell/spufs/inode.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,10 @@ static int spufs_fill_dir(struct dentry *dir,
192192
return -ENOMEM;
193193
ret = spufs_new_file(dir->d_sb, dentry, files->ops,
194194
files->mode & mode, files->size, ctx);
195-
if (ret)
195+
if (ret) {
196+
dput(dentry);
196197
return ret;
198+
}
197199
files++;
198200
}
199201
return 0;

0 commit comments

Comments
 (0)