Message ID | 20250313043020.GD2123707@ZenIV (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [1/4] spufs: fix a leak on spufs_new_file() failure | expand |
On Thu, Mar 13, 2025 at 04:30:20AM +0000, Al Viro wrote: > failure to allocate inode => leaked dentry... > > this one had been there since the initial merge; to be fair, > if we are that far OOM, the odds of failing at that particular > allocation are low... > > Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> > --- Reviewed-by: Christian Brauner <brauner@kernel.org>
diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c index b27791029fa9..b9f4a2937c3a 100644 --- a/drivers/infiniband/hw/qib/qib_fs.c +++ b/drivers/infiniband/hw/qib/qib_fs.c @@ -55,6 +55,7 @@ static int qibfs_mknod(struct inode *dir, struct dentry *dentry, struct inode *inode = new_inode(dir->i_sb); if (!inode) { + dput(dentry); error = -EPERM; goto bail; }
failure to allocate inode => leaked dentry... this one had been there since the initial merge; to be fair, if we are that far OOM, the odds of failing at that particular allocation are low... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> --- drivers/infiniband/hw/qib/qib_fs.c | 1 + 1 file changed, 1 insertion(+)