Skip to content

Commit 0f5cce3

Browse files
author
Al Viro
committed
spufs: fix a leak in spufs_create_context()
Leak fixes back in 2008 missed one case - if we are trying to set affinity and spufs_mkdir() fails, we need to drop the reference to neighbor. Fixes: 5811906 "[POWERPC] spufs: Fix memory leak on SPU affinity" Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent c134dea commit 0f5cce3

File tree

1 file changed

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

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,11 @@ spufs_create_context(struct inode *inode, struct dentry *dentry,
460460
}
461461

462462
ret = spufs_mkdir(inode, dentry, flags, mode & 0777);
463-
if (ret)
463+
if (ret) {
464+
if (neighbor)
465+
put_spu_context(neighbor);
464466
goto out_aff_unlock;
467+
}
465468

466469
if (affinity) {
467470
spufs_set_affinity(flags, SPUFS_I(d_inode(dentry))->i_ctx,

0 commit comments

Comments
 (0)