module/decompress: Fix error checking on zstd decompression
PATCH 1/1 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 Luis Chamberlain <[email protected]>
Cc Dmitry Torokhov <[email protected]>
Cc Stephen Boyd <[email protected]>
Signed-off-by Lucas De Marchi <[email protected]>
--- kernel/module/decompress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/module/decompress.c +1 -1
@@ -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; }
Signature · 1 line
2.40.1
Luis Chamberlain
maintainerQuoted 9 lines · Lucas De Marchi
While implementing support for in-kernel decompression in kmod,
finit_module()was returning a very suspicious value:finit_module(3, "", MODULE_INIT_COMPRESSED_FILE) = 18446744072717407296It 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.
Quoted 6 lines
Fixes 169a58ad824d ("module/decompress: Support zstd in-kernel decompression")Cc Luis Chamberlain <[email protected]>Cc Dmitry Torokhov <[email protected]>Cc Stephen Boyd <[email protected]>Signed-off-by Lucas De Marchi <[email protected]>
Applied and pushed, will send a pull to Linus right away, thanks!
Luis