ARM: sun9i: smp: fix out-of-bounds access error
Florian Fainelli
Reviewed-byQuoted 4 lines · William Zhang
When running
multi_v7_defconfigwithCONFIG_UBSANenabled, kernel reports UBSAN array-index-out-of-bounds error insunxi_mc_smp_initfunction on non-sunxi platform.
Quoted 8 lines
Checking index to the
sunxi_mc_smp_dataarray for out-of-bounds condition is needed to cover non-sunxi platform. Also fix the handling of return value fromof_property_match_stringfunction. Only negitive value is an error condition and should bail out from the function.Fixes 1631090e34f5 ("ARM: sun9i: smp: Add is_a83t field")Signed-off-by William Zhang <[email protected]>
FWIW:
Reviewed-by Florian Fainelli <[email protected]>
Signature · 1 line
Florian