From: Lucas De Marchi Date: Thu, 1 Jun 2023 21:23:31 +0000 (-0700) Subject: module/decompress: Fix error checking on zstd decompression X-Git-Tag: v6.6.7~2743^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fadb74f9f2f609238070c7ca1b04933dc9400e4a;p=platform%2Fkernel%2Flinux-starfive.git module/decompress: Fix error checking on zstd decompression While implementing support for in-kernel decompression in kmod, finit_module() was returning a very suspicious value: finit_module(3, "", MODULE_INIT_COMPRESSED_FILE) = 18446744072717407296 It turns out the check for module_get_next_page() failing is wrong, and hence the decompression was not really taking place. Invert the condition to fix it. Fixes: 169a58ad824d ("module/decompress: Support zstd in-kernel decompression") Cc: stable@kernel.org Cc: Luis Chamberlain Cc: Dmitry Torokhov Cc: Stephen Boyd Signed-off-by: Lucas De Marchi Signed-off-by: Luis Chamberlain --- diff --git a/kernel/module/decompress.c b/kernel/module/decompress.c index e97232b..8a5d6d6 100644 --- a/kernel/module/decompress.c +++ b/kernel/module/decompress.c @@ -257,7 +257,7 @@ static ssize_t module_zstd_decompress(struct load_info *info, do { struct page *page = module_get_next_page(info); - if (!IS_ERR(page)) { + if (IS_ERR(page)) { retval = PTR_ERR(page); goto out; }