Make sure we actually have a dev before dereferencing in case someone
botches and sends us a NULL pointer. The other code in this file seems to expect it to be able to handle it behaving this way.
This commit is contained in:
parent
de950c003c
commit
569d3c4bf0
@ -1154,7 +1154,7 @@ device_get_devclass(device_t dev)
|
||||
const char *
|
||||
device_get_name(device_t dev)
|
||||
{
|
||||
if (dev->devclass)
|
||||
if (dev != NULL && dev->devclass)
|
||||
return (devclass_get_name(dev->devclass));
|
||||
return (NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user