Commit 9f801ea8 authored by Zijun Hu's avatar Zijun Hu Committed by Carlos Llamas
Browse files

UPSTREAM: of: property: Increase NR_FWNODE_REFERENCE_ARGS



[ Upstream commit eb50844d ]

Currently, the following two macros have different values:

// The maximal argument count for firmware node reference
 #define NR_FWNODE_REFERENCE_ARGS	8
// The maximal argument count for DT node reference
 #define MAX_PHANDLE_ARGS 16

It may cause firmware node reference's argument count out of range if
directly assign DT node reference's argument count to firmware's.

drivers/of/property.c:of_fwnode_get_reference_args() is doing the direct
assignment, so may cause firmware's argument count @args->nargs got out
of range, namely, in [9, 16].

Fix by increasing NR_FWNODE_REFERENCE_ARGS to 16 to meet DT requirement.
Will align both macros later to avoid such inconsistency.

Fixes: 3e3119d3 ("device property: Introduce fwnode_property_get_reference_args")
Change-Id: I65f2717f313ac35d6a1d9ab65f62302b78e4e02b
Signed-off-by: default avatarZijun Hu <quic_zijuhu@quicinc.com>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Link: https://lore.kernel.org/r/20250225-fix_arg_count-v4-1-13cdc519eb31@quicinc.com


Signed-off-by: default avatarRob Herring (Arm) <robh@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
(cherry picked from commit bfcca46f)
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent f3f9ecfd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment