Commit 1a52a094 authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Rob Herring (Arm)
Browse files

of: address: Unify resource bounds overflow checking



The members "start" and "end" of struct resource are of type
"resource_size_t" which can be 32bit wide.
Values read from OF however are always 64bit wide.

Refactor the diff overflow checks into a helper function.
Also extend the checks to validate each calculation step.

Signed-off-by: default avatarThomas Weißschuh <thomas.weissschuh@linutronix.de>
Link: https://lore.kernel.org/r/20240906-of-address-overflow-v1-1-19567aaa61da@linutronix.de


[robh: Fix to not return error on 0 sized resource]
Signed-off-by: default avatarRob Herring (Arm) <robh@kernel.org>
parent 22e2bf12
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment