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 838D13F65EF for ; Fri, 8 May 2026 14:52:09 +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=1778251929; cv=none; b=RzLDqyjVmPF2BAKa6JgCdI/eQNrkMbOU9kb8JVjTDT1cqbaZywbs2/AhiH/jMUbb5/kUUQmzs4YxEx37fbcuhCjMg6PkSOR10VW3DHA3fyocMvzvcHftpciQbuEFbKlOJiDaNGyimL/xYzjODQsgwqWQJU6r4voZpALbkzm7QPU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778251929; c=relaxed/simple; bh=U6+s7VNGFOqhekbVCtNTfZ3+2uDzQgOI6g2f2RGRu8w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CbYKwdwRkX8Kfvglwcyrh1D8RlHfLd/XBjkz6w106JHMKQGKgoXzq/PWfgYU4aiU9Gu7U/UyfUE4bwYjWklouoqitdInBGREbFYBkptqAGRXF+VmrVQgg1kX2IUJ5pBhUpmSKr4WHDIKccb0Q8OEgq0DJxXDKqfjh+7eTe082Z0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=J9HckgL1; 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="J9HckgL1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90CA4C2BCC7; Fri, 8 May 2026 14:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778251929; bh=U6+s7VNGFOqhekbVCtNTfZ3+2uDzQgOI6g2f2RGRu8w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J9HckgL1ODU95iHCqirtE/gOuQK/PF7l4WXmKiosYPysGYvk6JuOErZveYoPxEUfj RHMi0HtWjG0CIQXEkTRNXTqtUbiIW3t7OFjb1ZPEJe1j0/6nhZV8CG2mzx9gSPrMgJ mEGy/XELUD/4DhrakdmTL/Z9mMikvup2M9RV3krivghtxxKrh2zH7vyCurKOvRBkGZ ZqjHiMC5Lv6/ROkaBPS6u8TPGW/cKKtPUbvKVBDQnoixo9nyaXi0m9qd1NuO4yf8LZ z4A0gAeOuuVKIA+8w1vJfYMDhbUhemPlxxl8FIa4zWvv0pgwixmJii9I8jSy3yANXR hPnmHeYyxSJHA== From: Sasha Levin To: stable@vger.kernel.org Cc: Haoxiang Li , "Darrick J. Wong" , Carlos Maiolino , Sasha Levin Subject: [PATCH 6.1.y] xfs: fix a resource leak in xfs_alloc_buftarg() Date: Fri, 8 May 2026 10:52:06 -0400 Message-ID: <20260508145206.1512706-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026050314-humming-baboon-4d05@gregkh> References: <2026050314-humming-baboon-4d05@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 257945cdf63b8..34e476301342c 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -2036,6 +2036,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