The patch titled Subject: zsmalloc: zs_destroy_pool: add size_class NULL check has been added to the -mm mm-hotfixes-unstable branch. Its filename is zsmalloc-zs_destroy_pool-add-size_class-null-check.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/zsmalloc-zs_destroy_pool-add-size_class-null-check.patch This patch will later appear in the mm-hotfixes-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Alexey Romanov <avromanov@xxxxxxxxxxxxxx> Subject: zsmalloc: zs_destroy_pool: add size_class NULL check Date: Thu, 13 Oct 2022 14:28:25 +0300 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/20221013112825.61869-1-avromanov@xxxxxxxxxxxxxx Fixes: f24263a5a076 ("zsmalloc: remove unnecessary size_class NULL check") Signed-off-by: Alexey Romanov <avromanov@xxxxxxxxxxxxxx> Reviewed-by: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx> Cc: Minchan Kim <minchan@xxxxxxxxxx> Cc: Nitin Gupta <ngupta@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/zsmalloc.c | 3 +++ 1 file changed, 3 insertions(+) --- a/mm/zsmalloc.c~zsmalloc-zs_destroy_pool-add-size_class-null-check +++ a/mm/zsmalloc.c @@ -2311,6 +2311,9 @@ void zs_destroy_pool(struct zs_pool *poo int fg; struct size_class *class = pool->size_class[i]; + if (!class) + continue; + if (class->index != i) continue; _ Patches currently in -mm which might be from avromanov@xxxxxxxxxxxxxx are zsmalloc-zs_destroy_pool-add-size_class-null-check.patch