xfs: fix a resource leak in xfs_alloc_buftarg()

In the error path, call fs_put_dax() to drop the DAX
device reference.

Fixes: 6f643c57d5 ("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>
This commit is contained in:
Haoxiang Li
2026-04-01 12:02:41 +08:00
committed by Carlos Maiolino
parent c658488886
commit 29a7b26143

View 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);
}