Re: [PATCH] mm/zswap: fix error pointer free in zswap_cpu_comp_prepare()

From: Nhat Pham
Date: Sun Jan 04 2026 - 03:41:35 EST


On Tue, Dec 30, 2025 at 11:46 PM Pavel Butsykin
<pbutsykin@xxxxxxxxxxxxxx> wrote:
>
> crypto_alloc_acomp_node() may return ERR_PTR(), but the fail path checks
> only for NULL and can pass an error pointer to crypto_free_acomp().
> Use IS_ERR_OR_NULL() to only free valid acomp instances.
>
> Fixes: 779b9955f643 ("mm: zswap: move allocations during CPU init outside the lock")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Pavel Butsykin <pbutsykin@xxxxxxxxxxxxxx>

Acked-by: Nhat Pham <nphamcs@xxxxxxxxx>