diff options
| author | Sughosh Ganu <[email protected]> | 2025-03-03 19:02:26 +0530 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-03-17 19:39:27 -0600 |
| commit | 56f186a68b35e8b45136fd44b69c554a0bb0ce35 (patch) | |
| tree | 133f5792ddff48913c6df72ab72777920420ade1 /include | |
| parent | 9943015f1b39fcb2de16ee72f1599c342620c561 (diff) | |
lmb: check if a region can be reserved by lmb_reserve()
The logic used in lmb_alloc() takes into consideration the existing
reserved regions, and ensures that the allocated region does not
overlap with any existing allocated regions. The lmb_reserve()
function is not doing any such checks -- the requested region might
overlap with an existing region. This also shows up with
lmb_alloc_addr() as this function ends up calling lmb_reserve().
Add a function which checks if the region requested is overlapping
with an existing reserved region, and allow for the reservation to
happen only if both the regions have LMB_NONE flag, which allows
re-requesting of the region. In any other scenario of an overlap, have
lmb_reserve() return -EEXIST, implying that the requested region is
already reserved.
Add corresponding test cases which check for overlapping reservation
requests made through lmb_reserve() and lmb_alloc_addr(). And while
here, fix some of the comments in the test function being touched.
Signed-off-by: Sughosh Ganu <[email protected]>
Reviewed-by: Heinrich Schuchardt <[email protected]>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
