aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot
diff options
context:
space:
mode:
authorMike Ditto <mditto@consentry.com>2008-10-17 05:27:51 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-21 00:17:48 -0400
commit59fd6b8cc0975b88e35f6ca2318b8cee77d3a508 (patch)
treebca9e11375be03e5cbe71cc9962c37993bb3382c /arch/powerpc/boot
parente81703724a966120ace6504c993bda9e084cbf3e (diff)
powerpc: Fix boot wrapper memcmp() called with zero length argument
I noticed, when trying to use, e.g., node = find_node_by_prop_value(prev, "booleanprop", "", 0)) to search for all nodes with a certain boolean property, that memcmp() returns garbage when comparing zero bytes. It should return zero. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r--arch/powerpc/boot/string.S4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/powerpc/boot/string.S b/arch/powerpc/boot/string.S
index 643e4cb2f11d..acc9428f2789 100644
--- a/arch/powerpc/boot/string.S
+++ b/arch/powerpc/boot/string.S
@@ -235,7 +235,7 @@ memchr:
235 .globl memcmp 235 .globl memcmp
236memcmp: 236memcmp:
237 cmpwi 0,r5,0 237 cmpwi 0,r5,0
238 blelr 238 ble 2f
239 mtctr r5 239 mtctr r5
240 addi r6,r3,-1 240 addi r6,r3,-1
241 addi r4,r4,-1 241 addi r4,r4,-1
@@ -244,6 +244,8 @@ memcmp:
244 subf. r3,r0,r3 244 subf. r3,r0,r3
245 bdnzt 2,1b 245 bdnzt 2,1b
246 blr 246 blr
2472: li r3,0
248 blr
247 249
248 250
249/* 251/*