提交 45af1d7a 编写于 作者: M Miaoqian Lin 提交者: Luis Chamberlain

module: Fix NULL vs IS_ERR checking for module_get_next_page

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: b1ae6dc4 ("module: add in-kernel support for decompressing")
Signed-off-by: NMiaoqian Lin <linmq006@gmail.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com
Signed-off-by: NLuis Chamberlain <mcgrof@kernel.org>
上级 96a1a241
...@@ -114,8 +114,8 @@ static ssize_t module_gzip_decompress(struct load_info *info, ...@@ -114,8 +114,8 @@ static ssize_t module_gzip_decompress(struct load_info *info,
do { do {
struct page *page = module_get_next_page(info); struct page *page = module_get_next_page(info);
if (!page) { if (IS_ERR(page)) {
retval = -ENOMEM; retval = PTR_ERR(page);
goto out_inflate_end; goto out_inflate_end;
} }
...@@ -173,8 +173,8 @@ static ssize_t module_xz_decompress(struct load_info *info, ...@@ -173,8 +173,8 @@ static ssize_t module_xz_decompress(struct load_info *info,
do { do {
struct page *page = module_get_next_page(info); struct page *page = module_get_next_page(info);
if (!page) { if (IS_ERR(page)) {
retval = -ENOMEM; retval = PTR_ERR(page);
goto out; goto out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册