diff options
author | imp <imp@FreeBSD.org> | 2008-08-23 18:22:49 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2008-08-23 18:22:49 +0000 |
commit | 2eac2c424f8989e9605b40c2ed054ace66c8f0d6 (patch) | |
tree | 04554ba8861dde4d768cea7514c3c7e22d370e30 /sys | |
parent | a45fc650347690738be16d0c27022bff273e2eff (diff) | |
download | FreeBSD-src-2eac2c424f8989e9605b40c2ed054ace66c8f0d6.zip FreeBSD-src-2eac2c424f8989e9605b40c2ed054ace66c8f0d6.tar.gz |
Handle the error case properly for device_get_children.
Diffstat (limited to 'sys')
-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; |