diff options
| author | Yuntao Wang <yuntao.wang@linux.dev> | 2025-11-15 21:47:48 +0800 |
|---|---|---|
| committer | Rob Herring (Arm) <robh@kernel.org> | 2025-11-20 08:32:48 -0600 |
| commit | 463942de13cd30fad5dba709f708483eab7efc2c (patch) | |
| tree | eb75913b3f9f0d002ab4712647f4d8a2c144c349 /scripts/livepatch/init.c | |
| parent | bec5f6092bc1328895992ff02b862ba34b45a0b7 (diff) | |
of/fdt: Fix the len check in early_init_dt_check_for_usable_mem_range()
The len value is in bytes, while `dt_root_addr_cells + dt_root_size_cells`
is in cells (4 bytes per cell). Modulo calculation between them is
incorrect, the units must be converted first.
Use helper functions to simplify the code and fix this issue.
Fixes: fb319e77a0e7 ("of: fdt: Add memory for devices by DT property "linux,usable-memory-range"")
Fixes: 2af2b50acf9b9c38 ("of: fdt: Add generic support for handling usable memory range property")
Fixes: 8f579b1c4e347b23 ("arm64: limit memory regions based on DT property, usable-memory-range")
Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>
Link: https://patch.msgid.link/20251115134753.179931-4-yuntao.wang@linux.dev
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Diffstat (limited to 'scripts/livepatch/init.c')
0 files changed, 0 insertions, 0 deletions
