[PATCH] xfs: fix a resource leak in xfs_alloc_buftarg()
From: Haoxiang Li
Date: Wed Apr 01 2026 - 00:03:05 EST
In the error path, call fs_put_dax() to drop the DAX
device reference.
Fixes: 6f643c57d57c ("xfs: implement ->notify_failure() for XFS")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Haoxiang Li <lihaoxiang@xxxxxxxxxxxxxxxx>
---
fs/xfs/xfs_buf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 47edf3041631..1ca95ef46a73 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1831,6 +1831,7 @@ xfs_alloc_buftarg(
return btp;
error_free:
+ fs_put_dax(btp->bt_daxdev, mp);
kfree(btp);
return ERR_PTR(error);
}
--
2.25.1