Re: [PATCH v2 1/2] mm: zswap: Remove redundant checks in zswap_cpu_comp_dead().
From: Kanchana P. Sridhar
Date: Tue Mar 17 2026 - 17:09:55 EST
On Tue, Mar 17, 2026 at 12:19 PM Yosry Ahmed <yosry@xxxxxxxxxx> wrote:
>
> On Mon, Mar 16, 2026 at 6:48 PM Kanchana P. Sridhar
> <kanchanapsridhar2026@xxxxxxxxx> wrote:
> >
> > There are presently redundant checks on the per-CPU acomp_ctx and it's
> > "req" member in zswap_cpu_comp_dead(): redundant because they are
> > inconsistent with zswap_pool_create() handling of failure in allocating
> > the acomp_ctx, and with the expected NULL return value from the
> > acomp_request_alloc() API when it fails to allocate an acomp_req.
> >
> > Fix these by converting to them to be NULL checks.
> >
> > Add comments in zswap_cpu_comp_prepare() clarifying the expected return
> > values of the crypto_alloc_acomp_node() and acomp_request_alloc() API.
> >
> > Suggested-by: Yosry Ahmed <yosry@xxxxxxxxxx>
> > Signed-off-by: Kanchana P. Sridhar <kanchanapsridhar2026@xxxxxxxxx>
>
> Acked-by: Yosry Ahmed <yosry@xxxxxxxxxx>
Thanks Yosry!