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:
Warner Losh 2004-06-28 02:24:04 +00:00
parent 9e84f80bf9
commit d5ca7f4f2b

View File

@ -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