From: Haoxiang Li Date: Wed, 1 Apr 2026 04:02:41 +0000 (+0800) Subject: xfs: fix a resource leak in xfs_alloc_buftarg() X-Git-Tag: v7.1-rc1~225^2~10 X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=29a7b2614357393b176ef06ba5bc3ff5afc8df69;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Darrick J. Wong Signed-off-by: Carlos Maiolino --- diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index ee8c3944015a1..580d40a5ee579 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); }