This is a note to let you know that I've just added the patch titled module: Fix NULL vs IS_ERR checking for module_get_next_page to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: module-fix-null-vs-is_err-checking-for-module_get_ne.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 4dec6c1bd8fb9393812bdd2240d553fea21992bd Author: Miaoqian Lin <linmq006@xxxxxxxxx> Date: Thu Nov 10 06:58:34 2022 +0400 module: Fix NULL vs IS_ERR checking for module_get_next_page [ Upstream commit 45af1d7aae7d5520d2858f8517a1342646f015db ] The module_get_next_page() function return error pointers on error instead of NULL. Use IS_ERR() to check the return value to fix this. Fixes: b1ae6dc41eaa ("module: add in-kernel support for decompressing") Signed-off-by: Miaoqian Lin <linmq006@xxxxxxxxx> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx Signed-off-by: Luis Chamberlain <mcgrof@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/kernel/module/decompress.c b/kernel/module/decompress.c index c033572d83f0..720e719253cd 100644 --- a/kernel/module/decompress.c +++ b/kernel/module/decompress.c @@ -114,8 +114,8 @@ static ssize_t module_gzip_decompress(struct load_info *info, do { struct page *page = module_get_next_page(info); - if (!page) { - retval = -ENOMEM; + if (IS_ERR(page)) { + retval = PTR_ERR(page); goto out_inflate_end; } @@ -173,8 +173,8 @@ static ssize_t module_xz_decompress(struct load_info *info, do { struct page *page = module_get_next_page(info); - if (!page) { - retval = -ENOMEM; + if (IS_ERR(page)) { + retval = PTR_ERR(page); goto out; }