mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
ofwbus: only allow unit number zero
ofwbus has always been the root of attachment for OFW/FDT platforms. It may have simplebus children, but we expect only one instance of the ofwbus driver, added directly by nexus. We may as well ensure this remains the case. Reviewed by: jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D38493
This commit is contained in:
parent
53d5e65eea
commit
afca197f52
1 changed files with 5 additions and 0 deletions
|
|
@ -89,6 +89,11 @@ ofwbus_probe(device_t dev)
|
|||
if (OF_peer(0) == 0)
|
||||
return (ENXIO);
|
||||
|
||||
/* Only one instance of ofwbus. */
|
||||
if (device_get_unit(dev) != 0)
|
||||
panic("ofwbus added with non-zero unit number: %d\n",
|
||||
device_get_unit(dev));
|
||||
|
||||
device_set_desc(dev, "Open Firmware Device Tree");
|
||||
return (BUS_PROBE_NOWILDCARD);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue