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 B84C338550B for ; Thu, 26 Feb 2026 03:02:01 +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=1772074921; cv=none; b=XWqgKH0omBuEpBmKTj7gQPd8KYxJRMUbGFBDhmMJePhWs82hfBe7nO1iH5vpubOUj6K3pougpHoFazX5CP7UDUM2b7iP713Bbvl9tMCDM/0LUz2y9I098BemARbbZGasBJCWLcEUfs/A3VjHTV8uAb1+aFWZyOFaat3dgkkBnzk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772074921; c=relaxed/simple; bh=1/RYS6q0JaRBii67En16Ao4AN45fjFM8ZdQfxDIKvrI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=K4vLy9Pl4mKegKUaDdkuNAjeVitV0Qt3DqKb4LafvoE4CLUdPv9YDeAM73oUSw8Is96ozPUo/uVYRaPsZ/4POeqvVDGuEGXWbgq4vBpb2dbnA6cQ4u9mYZ8dKRZ/vsGIC/B7WB8PREw9UQXqHY+zTavPbNQyyDHZ4ArCOO1Ayx4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aPPcQeiG; 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="aPPcQeiG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F3D7C19425; Thu, 26 Feb 2026 03:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772074921; bh=1/RYS6q0JaRBii67En16Ao4AN45fjFM8ZdQfxDIKvrI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aPPcQeiGm4ASLwNAptHkoIVPgrw8AU9Kg/PUAu6Ezhn3OWYBcUI+L2svW5tI+oGfz 2kBGS5rf0weW3iOGs02avvXc86tiRGrqlesClPBuen3XqjOfwxQ0ZjAQbiYdk5dTIz WjDzmcdxqX+qUmrb/I82xJFTImxin7dS6EmT+/7e1XrcYJeIvtFu/yaP+UFwz1ifE7 rkkA0Vk02sqaKmcyaQJvSFaQCjQ4FFBwbH8h+doclDx16zhmKYEbi2AyvuCAgjm3GE jhF3Oy/5/eSDrTdcBtd27M9rTQRcXAqooqGxC9DlHpNBSOhK/M1s72E+EYO0aPWnlw /SRD700sdfBAQ== From: Kees Cook To: Cole Leavitt Cc: Kees Cook , tony.luck@intel.com, gpiccoli@igalia.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pstore/ram: fix resource leak when ioremap() fails Date: Wed, 25 Feb 2026 19:01:04 -0800 Message-Id: <177207486192.3692284.571733753516390248.b4-ty@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260225235406.11790-1-cole@unwrap.rs> References: <20260225235406.11790-1-cole@unwrap.rs> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On Wed, 25 Feb 2026 16:54:06 -0700, Cole Leavitt wrote: > In persistent_ram_iomap(), ioremap() or ioremap_wc() may return NULL on > failure. Currently, if this happens, the function returns NULL without > releasing the memory region acquired by request_mem_region(). > > This leads to a resource leak where the memory region remains reserved > but unusable. > > [...] Thanks! I tweaked the patch a bit and applied to for-next/pstore, thanks! [1/1] pstore/ram: fix resource leak when ioremap() fails https://git.kernel.org/kees/c/bb5278a89dad Take care, -- Kees Cook