[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221013112825.61869-1-avromanov@sberdevices.ru>
Date: Thu, 13 Oct 2022 14:28:25 +0300
From: Alexey Romanov <avromanov@...rdevices.ru>
To: <minchan@...nel.org>, <senozhatsky@...omium.org>,
<ngupta@...are.org>, <akpm@...ux-foundation.org>
CC: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
<kernel@...rdevices.ru>, Alexey Romanov <avromanov@...rdevices.ru>
Subject: [PATCH v1] zsmalloc: zs_destroy_pool: add size_class NULL check
Inside the zs_destroy_pool() function, there can still
be NULL size_class pointers: if when the next size_class is
allocated, inside zs_create_pool() function, kzalloc will
return NULL and handling the error condition, zs_create_pool()
will call zs_destroy_pool().
Fixes: f24263a5a076 ("zsmalloc: remove unnecessary size_class NULL check")
Signed-off-by: Alexey Romanov <avromanov@...rdevices.ru>
---
mm/zsmalloc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 525758713a55..d03941cace2c 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -2311,6 +2311,9 @@ void zs_destroy_pool(struct zs_pool *pool)
int fg;
struct size_class *class = pool->size_class[i];
+ if (!class)
+ continue;
+
if (class->index != i)
continue;
--
2.25.1
Powered by blists - more mailing lists