linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/vmalloc: Fix return value check for vb_alloc
@ 2024-02-28  8:50 刘海龙(LaoLiu)
  2024-02-28  9:34 ` Barry Song
  0 siblings, 1 reply; 5+ messages in thread
From: 刘海龙(LaoLiu) @ 2024-02-28  8:50 UTC (permalink / raw)
  To: akpm, urezki, hch, lstoakes, linux-mm, linux-kernel

If vm_map_ram(page, 0, 0) would cause panic by vmap_pages_range_noflush, so
change IS_ERR to IS_ERR_OR_NULL to fix this.

Signed-off-by: Hailong.Liu <liuhailong@oppo.com>
---
 mm/vmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index d12a17fc0c17..109732006cf7 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2387,7 +2387,7 @@ void *vm_map_ram(struct page **pages, unsigned int
count, int node)

        if (likely(count <= VMAP_MAX_ALLOC)) {
                mem = vb_alloc(size, GFP_KERNEL);
-               if (IS_ERR(mem))
+               if (IS_ERR_OR_NULL(mem))
                        return NULL;
                addr = (unsigned long)mem;
        } else {
--
2.34.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-28 10:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-28  8:50 [PATCH] mm/vmalloc: Fix return value check for vb_alloc 刘海龙(LaoLiu)
2024-02-28  9:34 ` Barry Song
2024-02-28  9:39   ` Barry Song
2024-02-28 10:02   ` 刘海龙(LaoLiu)
2024-02-28 10:09     ` Barry Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox