diff options
author | James Gowans <[email protected]> | 2024-06-19 11:55:55 +0200 |
---|---|---|
committer | Mike Rapoport (IBM) <[email protected]> | 2024-06-19 18:05:25 +0300 |
commit | 94ff46de4a738e7916b68ab5cc0b0380729f02af (patch) | |
tree | 2ca29d5f03b071692b102a4a535d6b2a5251ad43 /rust/kernel | |
parent | d9d814eebb1ae9742e7fd7f39730653b16326bd4 (diff) |
memblock: Move late alloc warning down to phys alloc
If a driver/subsystem tries to do an allocation after the memblock
allocations have been freed and the memory handed to the buddy
allocator, it will not actually be legal to use that allocation: the
buddy allocator owns the memory. Currently this mis-use is handled by
the memblock function which does allocations and returns virtual
addresses by printing a warning and doing a kmalloc instead. However
the physical allocation function does not to do this check - callers of
the physical alloc function are unprotected against mis-use.
Improve the error catching here by moving the check into the physical
allocation function which is used by the virtual addr allocation
function.
Signed-off-by: James Gowans <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Alex Graf <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
Diffstat (limited to 'rust/kernel')
0 files changed, 0 insertions, 0 deletions