diff options
author | Nathan Binkert <nate@cvs.openbsd.org> | 2002-07-29 02:38:55 +0000 |
---|---|---|
committer | Nathan Binkert <nate@cvs.openbsd.org> | 2002-07-29 02:38:55 +0000 |
commit | e7e2b9840b4e830ba829c5b9da9029a0fd088428 (patch) | |
tree | 8ddc7e4f53b4871fa11bd2776545926ab0b91452 /sys/dev/usb/if_kue.c | |
parent | 486f4b964fc98019f0ba8d90843df3b32d84244a (diff) |
Refetch interface handle on reset. Avoids potential access to freed memory.
From FreeBSD via NetBSD
Diffstat (limited to 'sys/dev/usb/if_kue.c')
-rw-r--r-- | sys/dev/usb/if_kue.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index 39afbc6b1f6..3fc84ad33b8 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -1,5 +1,5 @@ -/* $OpenBSD: if_kue.c,v 1.21 2002/07/25 02:18:10 nate Exp $ */ -/* $NetBSD: if_kue.c,v 1.48 2002/07/08 17:46:24 augustss Exp $ */ +/* $OpenBSD: if_kue.c,v 1.22 2002/07/29 02:38:54 nate Exp $ */ +/* $NetBSD: if_kue.c,v 1.50 2002/07/16 22:00:31 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. @@ -388,12 +388,11 @@ allmulti: Static void kue_reset(struct kue_softc *sc) { - usbd_status err; - DPRINTFN(5,("%s: %s: enter\n", USBDEVNAME(sc->kue_dev), __func__)); - err = usbd_set_config_no(sc->kue_udev, KUE_CONFIG_NO, 1); - if (err) + if (usbd_set_config_no(sc->kue_udev, KUE_CONFIG_NO, 1) || + usbd_device2interface_handle(sc->kue_udev, KUE_IFACE_IDX, + &sc->kue_iface)) printf("%s: reset failed\n", USBDEVNAME(sc->kue_dev)); /* Wait a little while for the chip to get its brains in order. */ |