Skip to content

Commit

Permalink
module/decompress: Fix error checking on zstd decompression
Browse files Browse the repository at this point in the history
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: 169a58a ("module/decompress: Support zstd in-kernel decompression")
Cc: stable@kernel.org
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
  • Loading branch information
Lucas De Marchi authored and Luis Chamberlain committed Jun 1, 2023
1 parent db3e33d commit fadb74f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/module/decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit fadb74f

Please sign in to comment.