Allow dev to be NULL and assume that a device is not alive or not
attached. Reviewed by: njl(?) and jhb
This commit is contained in:
parent
9e84f80bf9
commit
d5ca7f4f2b
@ -1587,13 +1587,13 @@ device_is_enabled(device_t dev)
|
||||
int
|
||||
device_is_alive(device_t dev)
|
||||
{
|
||||
return (dev->state >= DS_ALIVE);
|
||||
return (dev != NULL && dev->state >= DS_ALIVE);
|
||||
}
|
||||
|
||||
int
|
||||
device_is_attached(device_t dev)
|
||||
{
|
||||
return (dev->state >= DS_ATTACHED);
|
||||
return (dev != NULL && dev->state >= DS_ATTACHED);
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user