Message ID | 20250114-fix_arg_count-v2-1-efa35ee6572b@quicinc.com (mailing list archive) |
---|---|
State | Handled Elsewhere, archived |
Headers | show |
Series | [RFC,v2] of: property: Fix potential firmware node reference's argument count got out of range | expand |
On Tue, Jan 14, 2025 at 11:51:13PM +0800, Zijun Hu wrote: > From: Zijun Hu <quic_zijuhu@quicinc.com> > > 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 OF node reference > #define MAX_PHANDLE_ARGS 16 > > But of_fwnode_get_reference_args() directly assigns OF node > reference argument count @of_args.args_count to frimware firmware > @args->nargs, and may cause firmware node reference argument > count @of_args.args_count got out of range, namely, in [9, 16]. > > Fix by increasing NR_FWNODE_REFERENCE_ARGS to 16 to meet OF requirement.
diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h index 0731994b9d7c832cae8a30063f3a64194e4f19aa..6fa0a268d53827a376d7f258c6194a2a088e4325 100644 --- a/include/linux/fwnode.h +++ b/include/linux/fwnode.h @@ -91,7 +91,7 @@ struct fwnode_endpoint { #define SWNODE_GRAPH_PORT_NAME_FMT "port@%u" #define SWNODE_GRAPH_ENDPOINT_NAME_FMT "endpoint@%u" -#define NR_FWNODE_REFERENCE_ARGS 8 +#define NR_FWNODE_REFERENCE_ARGS 16 /** * struct fwnode_reference_args - Fwnode reference with additional arguments