diff options
-rw-r--r-- | sys/dev/sound/usb/uaudio.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 5e446ef..758d6cd 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -699,8 +699,8 @@ USB_DETACH(uaudio) err = bus_generic_detach(sc->sc_dev); - if (err == 0) { - device_get_children(sc->sc_dev, &devlist, &devcount); + if (err == 0 && + device_get_children(sc->sc_dev, &devlist, &devcount) == 0) { for (i = 0; devlist != NULL && i < devcount; i++) { func = device_get_ivars(devlist[i]); if (func != NULL && func->func == SCF_PCM && @@ -710,8 +710,7 @@ USB_DETACH(uaudio) device_delete_child(sc->sc_dev, devlist[i]); } } - if (devlist != NULL) - free(devlist, M_TEMP); + free(devlist, M_TEMP); } return err; |