e84742aa7b
Since commit7975f64222
("Fix widespread incorrect use of strneq(), replace with new strprefixeq()") simple-bus checks have been silently skipped. The problem was 'end - str' is one more than the string length and the strnlen in strprefixeq fails. This can't be fixed simply by subtracting one as it is possible to have multiple '\0' at the end of the property. Fix this by making the 'compatible' property string list check a dependency, and then we can assume the property is null terminated and we can just use streq() for comparisons. Add some tests so the problem doesn't happen again. Fixes:7975f64222
("Fix widespread incorrect use of strneq(), replace with new strprefixeq()") Reported-by: Kumar Gala <kumar.gala@linaro.org> Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
18 lines
245 B
Text
18 lines
245 B
Text
/dts-v1/;
|
|
|
|
/ {
|
|
#address-cells = <1>;
|
|
#size-cells = <1>;
|
|
|
|
bus@10000000 {
|
|
#address-cells = <1>;
|
|
#size-cells = <1>;
|
|
compatible = "foo-bus", "simple-bus";
|
|
ranges = <0x0 0x10000000 0x10000>;
|
|
|
|
node@100 {
|
|
reg = <0x1000 1>;
|
|
};
|
|
};
|
|
|
|
};
|