]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: fix a resource leak in xfs_alloc_buftarg()
authorHaoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Wed, 1 Apr 2026 04:02:41 +0000 (12:02 +0800)
committerCarlos Maiolino <cem@kernel.org>
Tue, 7 Apr 2026 11:17:35 +0000 (13:17 +0200)
In the error path, call fs_put_dax() to drop the DAX
device reference.

Fixes: 6f643c57d57c ("xfs: implement ->notify_failure() for XFS")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_buf.c

index ee8c3944015a1a875ab30b0086973cebf9ccf5b6..580d40a5ee5797a53372ee4bb8e20b81008ee2e9 100644 (file)
@@ -1756,6 +1756,7 @@ xfs_alloc_buftarg(
        return btp;
 
 error_free:
+       fs_put_dax(btp->bt_daxdev, mp);
        kfree(btp);
        return ERR_PTR(error);
 }