Skip to content

Commit 1bb2526

Browse files
Yuuoniyngboonkhai
authored andcommitted
module: Fix NULL vs IS_ERR checking for module_get_next_page
[ Upstream commit 45af1d7 ] 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: b1ae6dc ("module: add in-kernel support for decompressing") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 15545bc commit 1bb2526

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kernel/module/decompress.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ static ssize_t module_gzip_decompress(struct load_info *info,
114114
do {
115115
struct page *page = module_get_next_page(info);
116116

117-
if (!page) {
118-
retval = -ENOMEM;
117+
if (IS_ERR(page)) {
118+
retval = PTR_ERR(page);
119119
goto out_inflate_end;
120120
}
121121

@@ -173,8 +173,8 @@ static ssize_t module_xz_decompress(struct load_info *info,
173173
do {
174174
struct page *page = module_get_next_page(info);
175175

176-
if (!page) {
177-
retval = -ENOMEM;
176+
if (IS_ERR(page)) {
177+
retval = PTR_ERR(page);
178178
goto out;
179179
}
180180

0 commit comments

Comments
 (0)