From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B449326A1AF for ; Fri, 8 May 2026 13:22:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778246575; cv=none; b=Tk+wVJjMaCqKWzHtLKerBq7dLzA34xtCgXSTWXX+VFXieKAoSjyBNiXsx0g3HsDYMfUjI68uue5/s8shbQoBrn+E4CKfH4+Pd497E7T4ZOV1rT+Wd8CInCSr8jviCkL4keQlC1yzE7I16NV5Q+GFRh276DDLlj8667wkQ4B1HtE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778246575; c=relaxed/simple; bh=oFuAsL8YSWB4dBi5psi4Gpr9pQr/kU50sWzQ8/b+sm0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IV6U5bZj7a8f/yF1J5rPZTkCVgmuTbdIBYoZfMJ1J36/kPOhDtbuvqtku7De6N17j3UQ5gMZF8DKI9iFzHvDr8egiIIOKBZ/5Tiwe1QCaSovJ25Jo1S1qBqg/THFTseat/VlrKaMf5jdQRX6maIOIz2cR+WbZQZU+guDRi+7dg0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ED607bGC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ED607bGC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B49A2C2BCB0; Fri, 8 May 2026 13:22:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778246575; bh=oFuAsL8YSWB4dBi5psi4Gpr9pQr/kU50sWzQ8/b+sm0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ED607bGCX/KA6UDBN7fxpYLlB0L0a07QKSFl2DalTKTTiLxyEfw8MZU72oqG3Jyl1 q/DiLJ9wpbEUr+BLr4VZr+Cj6KRJ/vMmaVOV46Mza8a+tOq/eW10QNYiUXzL9Fyxbx M43bztPhixPNKU0o9zJadhER1KRabtt8P57wMQOwACLuy7oR3f1syc1qfinvwVFDlV WvZWlfNLhT2NcyT/c0SaSbeqiPDrTioZO/q8mB913s810K6CmyaGPqxHQkSG4aQf1N rrPxEVhBSEB4GpURUDyVpq6B/hvdhuokQe4XhlvOCv7mpBGZMD+J+g3gjjZyJiK/nO RbxyErFYkJ71w== From: Sasha Levin To: stable@vger.kernel.org Cc: Haoxiang Li , "Darrick J. Wong" , Carlos Maiolino , Sasha Levin Subject: [PATCH 6.6.y] xfs: fix a resource leak in xfs_alloc_buftarg() Date: Fri, 8 May 2026 09:22:52 -0400 Message-ID: <20260508132252.1479242-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026050313-manmade-batting-5838@gregkh> References: <2026050313-manmade-batting-5838@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Haoxiang Li [ Upstream commit 29a7b2614357393b176ef06ba5bc3ff5afc8df69 ] 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 [ kept `kmem_free(btp)` and `return NULL` instead of `kfree(btp)`/`ERR_PTR(error)` ] Signed-off-by: Sasha Levin --- 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 20c1d146af1da..1181108f80746 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -2045,6 +2045,7 @@ xfs_alloc_buftarg( error_lru: list_lru_destroy(&btp->bt_lru); error_free: + fs_put_dax(btp->bt_daxdev, mp); kmem_free(btp); return NULL; } -- 2.53.0