[PATCH] powerpc: Add missing error check to prom_find_boot_cpu()

Darren Stevens darren at stevens-zone.net
Tue Jan 24 06:42:54 AEDT 2017


prom_init.c calls 'instance-to-package' twice, but the return
is not checked during prom_find_boot_cpu(). The result is then
passed to prom_getprop, which could be PROM_ERROR.
Add a return check to prevent this.

This was found on a pasemi system, where CFE doesn't have a working
'instance-to package' prom call.
Before Commit 5c0484e25ec0 ('powerpc: Endian safe trampoline') the
area around addr 0 as mostly 0's and this doesn't cause a problem.
Once the macro 'FIXUP_ENDIAN' has been added to head_64.S, the low
memory area now has non-zero values, which cause the prom_getprop
call to hang.

Signed-off-by: Darren Stevens <darren at stevens-zone.net>

---
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: prom_init.patch
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20170123/9d20c725/attachment.ksh>


More information about the Linuxppc-dev mailing list