mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 20:10:23 +09:00
ANDROID: arm64: Fix MMIO guard ioremap when called before slab_is_available().
The ioremap hook can be called before slab is initialised, at which time
calling into kmalloc() is not allowed.
Signed-off-by: Keir Fraser <keirf@google.com>
Bug: 232894028
Fixes: f89d2055a3 ("ANDROID: arm64: Implement ioremap/iounmap hooks calling into KVM's MMIO guard")
Change-Id: Ieaf5adbdacdb196e37f4629998164a015e15c6d8
This commit is contained in:
@@ -108,7 +108,8 @@ void ioremap_phys_range_hook(phys_addr_t phys_addr, size_t size, pgprot_t prot)
|
||||
* This page will be permanently accessible, similar to a
|
||||
* saturated refcount.
|
||||
*/
|
||||
ref = kzalloc(sizeof(*ref), GFP_KERNEL);
|
||||
if (slab_is_available())
|
||||
ref = kzalloc(sizeof(*ref), GFP_KERNEL);
|
||||
if (ref) {
|
||||
refcount_set(&ref->count, 1);
|
||||
if (xa_err(xa_store(&ioremap_guard_array, pfn, ref,
|
||||
|
||||
Reference in New Issue
Block a user