]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
qibfs: fix _another_ leak
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 13 May 2024 23:50:34 +0000 (17:50 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:39:28 +0000 (07:39 +0200)
[ Upstream commit bdb43af4fdb39f844ede401bdb1258f67a580a27 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/qib/qib_fs.c

index e336d778e076eddb3d56c37b6fd33be0de87b050..5ec67e3c2d03cedf1276b429ee0daf5abbdb16d3 100644 (file)
@@ -56,6 +56,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;
        }