Skip to content

Commit 4249a05

Browse files
mRrvzakpm00
authored andcommitted
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(). Link: https://lkml.kernel.org/r/[email protected] Fixes: f24263a ("zsmalloc: remove unnecessary size_class NULL check") Signed-off-by: Alexey Romanov <[email protected]> Reviewed-by: Sergey Senozhatsky <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Nitin Gupta <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 7329e3e commit 4249a05

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mm/zsmalloc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,6 +2311,9 @@ void zs_destroy_pool(struct zs_pool *pool)
23112311
int fg;
23122312
struct size_class *class = pool->size_class[i];
23132313

2314+
if (!class)
2315+
continue;
2316+
23142317
if (class->index != i)
23152318
continue;
23162319

0 commit comments

Comments
 (0)