Skip to content

Commit e540b8c

Browse files
fancertsbogend
authored andcommitted
mips: mm: add slab availability checking in ioremap_prot
Recent commit a5f6164 ("mm/ioremap: add slab availability checking in ioremap_prot") added the slab availability check to the generic ioremap_prot() implementation. It is reasonable to be done for the MIPS32-specific method too since it also relies on the get_vm_area_caller() function (by means of get_vm_area()) which requires the slab allocator being up and running before being called. Signed-off-by: Serge Semin <fancer.lancer@gmail.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent 1c01502 commit e540b8c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

arch/mips/mm/ioremap.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ void __iomem *ioremap_prot(phys_addr_t phys_addr, unsigned long size,
7272
flags == _CACHE_UNCACHED)
7373
return (void __iomem *) CKSEG1ADDR(phys_addr);
7474

75+
/* Early remaps should use the unmapped regions til' VM is available */
76+
if (WARN_ON_ONCE(!slab_is_available()))
77+
return NULL;
78+
7579
/*
7680
* Don't allow anybody to remap RAM that may be allocated by the page
7781
* allocator, since that could lead to races & data clobbering.

0 commit comments

Comments
 (0)