armv7: Fix BeagleBone Black panic on system start
There is now assertion which requires all memory allocations of positive size. Negative and zero-sized allocations lead to panic, so plug them off. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D39846
This commit is contained in:
parent
2544b8e00c
commit
d43bf55fc5
@ -306,6 +306,9 @@ parse_regfields(struct ti_sysc_softc *sc) {
|
|||||||
|
|
||||||
/* Grab the content of reg properties */
|
/* Grab the content of reg properties */
|
||||||
nreg = OF_getproplen(node, "reg");
|
nreg = OF_getproplen(node, "reg");
|
||||||
|
if (nreg <= 0)
|
||||||
|
return (ENXIO);
|
||||||
|
|
||||||
reg = malloc(nreg, M_DEVBUF, M_WAITOK);
|
reg = malloc(nreg, M_DEVBUF, M_WAITOK);
|
||||||
OF_getencprop(node, "reg", reg, nreg);
|
OF_getencprop(node, "reg", reg, nreg);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user