mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Don't dereference parent pointer when it is NULL.
MFC after: 1 week Sponsored by: Mellanox Technologies
This commit is contained in:
parent
03219fba43
commit
88fa0d734c
1 changed files with 3 additions and 3 deletions
|
|
@ -211,11 +211,11 @@ device_register(struct device *dev)
|
|||
} else if (dev->parent == NULL) {
|
||||
bsddev = devclass_get_device(dev->class->bsdclass, 0);
|
||||
}
|
||||
|
||||
if (bsddev == NULL)
|
||||
if (bsddev == NULL && dev->parent != NULL) {
|
||||
bsddev = device_add_child(dev->parent->bsddev,
|
||||
dev->class->kobj.name, unit);
|
||||
if (bsddev) {
|
||||
}
|
||||
if (bsddev != NULL) {
|
||||
if (dev->devt == 0)
|
||||
dev->devt = makedev(0, device_get_unit(bsddev));
|
||||
device_set_softc(bsddev, dev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue