Browse Source
Since commitmain7975f64222
("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>
Rob Herring
6 years ago
committed by
David Gibson
4 changed files with 43 additions and 2 deletions
@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
|
||||
/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>; |
||||
}; |
||||
}; |
||||
|
||||
}; |
@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
|
||||
/dts-v1/; |
||||
|
||||
/ { |
||||
#address-cells = <1>; |
||||
#size-cells = <1>; |
||||
|
||||
bus@10000000 { |
||||
#address-cells = <1>; |
||||
#size-cells = <1>; |
||||
compatible = "simple-bus"; |
||||
ranges = <0x0 0x10000000 0x10000>; |
||||
|
||||
node@100 { |
||||
reg = <0x1000 1>; |
||||
}; |
||||
}; |
||||
|
||||
}; |
Loading…
Reference in new issue