]> Gentwo Git Trees - linux/.git/commit
of/fdt: Fix the len check in early_init_dt_check_for_elfcorehdr()
authorYuntao Wang <yuntao.wang@linux.dev>
Sat, 15 Nov 2025 13:47:47 +0000 (21:47 +0800)
committerRob Herring (Arm) <robh@kernel.org>
Thu, 20 Nov 2025 14:32:48 +0000 (08:32 -0600)
commitbec5f6092bc1328895992ff02b862ba34b45a0b7
treee9513a3092b58668a379a9c26be6979e6038a897
parent8278cb72c60399f6dc6300c409879fb4c7291513
of/fdt: Fix the len check in early_init_dt_check_for_elfcorehdr()

The len value is in bytes, while `dt_root_addr_cells + dt_root_size_cells`
is in cells (4 bytes per cell). Comparing them directly is incorrect.

Use a helper function to simplify the code and address this issue.

Fixes: f7e7ce93aac1 ("of: fdt: Add generic support for handling elf core headers property")
Fixes: e62aaeac426ab1dd ("arm64: kdump: provide /proc/vmcore file")
Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>
Link: https://patch.msgid.link/20251115134753.179931-3-yuntao.wang@linux.dev
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
drivers/of/fdt.c