diff options
author | 2025-03-08 19:26:31 -0500 | |
---|---|---|
committer | 2025-03-12 22:13:27 -0400 | |
commit | d1ca8698ca1332625d83ea0d753747be66f9906d (patch) | |
tree | 170cbab605d7a9ab3252d0d6416b712255b480c2 | |
parent | Linux 6.14-rc6 (diff) | |
download | wireguard-linux-d1ca8698ca1332625d83ea0d753747be66f9906d.tar.xz wireguard-linux-d1ca8698ca1332625d83ea0d753747be66f9906d.zip |
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: 3f51dd91c807 "[PATCH] spufs: fix spufs_fill_dir error path"
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/inode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 70236d1df3d3..793c005607cf 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c @@ -192,8 +192,10 @@ static int spufs_fill_dir(struct dentry *dir, return -ENOMEM; ret = spufs_new_file(dir->d_sb, dentry, files->ops, files->mode & mode, files->size, ctx); - if (ret) + if (ret) { + dput(dentry); return ret; + } files++; } return 0; |