summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaoxiang Li <lihaoxiang@isrc.iscas.ac.cn>2026-04-01 07:02:41 +0300
committerCarlos Maiolino <cem@kernel.org>2026-04-07 14:17:35 +0300
commit29a7b2614357393b176ef06ba5bc3ff5afc8df69 (patch)
tree3c54c17d00eb16f4c31efc5d5ad8c60b17c688d3
parentc6584888864e36d6225a6c16d8c39fd2aa9a45d8 (diff)
downloadlinux-29a7b2614357393b176ef06ba5bc3ff5afc8df69.tar.xz
xfs: fix a resource leak in xfs_alloc_buftarg()
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>
-rw-r--r--fs/xfs/xfs_buf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index ee8c3944015a..580d40a5ee57 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1756,6 +1756,7 @@ xfs_alloc_buftarg(
return btp;
error_free:
+ fs_put_dax(btp->bt_daxdev, mp);
kfree(btp);
return ERR_PTR(error);
}