Re: [PATCH] zram: free secondary algorithms names
From: Andrew Morton
Date: Mon Sep 16 2024 - 10:47:11 EST
On Wed, 11 Sep 2024 11:54:56 +0900 Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx> wrote:
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -2115,6 +2115,13 @@ static void zram_destroy_comps(struct zram *zram)
> zram->num_active_comps--;
> }
>
> + for (prio = ZRAM_SECONDARY_COMP; prio < ZRAM_MAX_COMPS; prio++) {
> + if (!zram->comp_algs[prio])
> + continue;
We'll probably get emails telling us that this test-for-null is unneeded...
> + kfree(zram->comp_algs[prio]);
> + zram->comp_algs[prio] = NULL;
> + }
> +
> zram_comp_params_reset(zram);
> }