Skip to content
Commit f3586024 authored by Rob Herring (Arm)'s avatar Rob Herring (Arm) Committed by Greg Kroah-Hartman
Browse files

usb: dwc3: Use of_property_read_variable_u32_array() to read "power"



There's no need to get the length of an DT array property before
parsing the array. of_property_read_variable_u32_array() takes a minimum
and maximum length and returns the actual length (or error code).

This is part of a larger effort to remove callers of of_find_property()
and similar functions. of_find_property() leaks the DT struct property
and data pointers which is a problem for dynamically allocated nodes
which may be freed.

Signed-off-by: default avatarRob Herring (Arm) <robh@kernel.org>
Acked-by: default avatarThinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20240731201407.1838385-5-robh@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 89b75391
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment