提交 59fd6b8c 编写于 作者: M Mike Ditto 提交者: Benjamin Herrenschmidt

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: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 e8170372
...@@ -235,7 +235,7 @@ memchr: ...@@ -235,7 +235,7 @@ memchr:
.globl memcmp .globl memcmp
memcmp: memcmp:
cmpwi 0,r5,0 cmpwi 0,r5,0
blelr ble 2f
mtctr r5 mtctr r5
addi r6,r3,-1 addi r6,r3,-1
addi r4,r4,-1 addi r4,r4,-1
...@@ -244,6 +244,8 @@ memcmp: ...@@ -244,6 +244,8 @@ memcmp:
subf. r3,r0,r3 subf. r3,r0,r3
bdnzt 2,1b bdnzt 2,1b
blr blr
2: li r3,0
blr
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册