]> git.baikalelectronics.ru Git - kernel.git/commit
zsmalloc: zs_destroy_pool: add size_class NULL check
authorAlexey Romanov <avromanov@sberdevices.ru>
Thu, 13 Oct 2022 11:28:25 +0000 (14:28 +0300)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 21 Oct 2022 04:27:21 +0000 (21:27 -0700)
commit21d62ea445cb4f075306fc2d60b76c53f15e8cc0
treeb8a5f83ae93d34f55c4a3119b5d8612691b09705
parent5ef930c7cb8d8299673ea8519a668534b8d41cb9
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/20221013112825.61869-1-avromanov@sberdevices.ru
Fixes: b448e4f972cc ("zsmalloc: remove unnecessary size_class NULL check")
Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/zsmalloc.c