mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 18:27:22 +00:00
ugen: fix USB_IFACE_DRIVER_ACTIVE after detaching a driver
Previosuly, USB_IFACE_DRIVER_ACTIVE would report that the driver is active even after it detached. That's because a device(9) still remains. So, add device_is_alive(9) check for more accurate reporting. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43960
This commit is contained in:
parent
b7dce5b8e9
commit
8f374fa528
|
@ -2377,12 +2377,10 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void *addr, int fflags)
|
|||
break;
|
||||
|
||||
case USB_IFACE_DRIVER_ACTIVE:
|
||||
|
||||
n = *u.pint & 0xFF;
|
||||
|
||||
iface = usbd_get_iface(f->udev, n);
|
||||
|
||||
if (iface && iface->subdev)
|
||||
if (iface != NULL && iface->subdev != NULL &&
|
||||
device_is_alive(iface->subdev))
|
||||
error = 0;
|
||||
else
|
||||
error = ENXIO;
|
||||
|
|
Loading…
Reference in a new issue