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

of: address: Fix empty resource handling in __of_address_resource_bounds()



"resource->end" needs to always be equal to "resource->start + size - 1".
The previous version of the function did not perform the "- 1" in case
of an empty resource.

Also make sure to allow an empty resource at address 0.

Reported-by: default avatarBasharath Hussain Khaja <basharath@couthit.com>
Closes: https://lore.kernel.org/lkml/20250108140414.13530-1-basharath@couthit.com/


Fixes: 1a52a094 ("of: address: Unify resource bounds overflow checking")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarThomas Weißschuh <thomas.weissschuh@linutronix.de>
Link: https://lore.kernel.org/r/20250120-of-address-overflow-v1-1-dd68dbf47bce@linutronix.de


Signed-off-by: default avatarRob Herring (Arm) <robh@kernel.org>
parent 14bce187
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment