diff options
| author | jmcneill <jmcneill@NetBSD.org> | 2008-10-06 02:21:50 +0000 |
|---|---|---|
| committer | jmcneill <jmcneill@NetBSD.org> | 2008-10-06 02:21:50 +0000 |
| commit | 04fec95922740f87f0883a3d18dffcc85a3189cd (patch) | |
| tree | 13839e5e728224fc5c4fc1c6dc96b09a199e1f55 /sys/dev | |
| parent | aef4db128dfb067e423a87de8f699b0081b8b7a8 (diff) | |
ehci_free_itd: use LIST_INSERT_HEAD rather than
LIST_INSERT_AFTER(LIST_FIRST(..), ..) when returning itds to the freelist
to prevent a crash when the freelist is empty. Reviewed by Jeremy Morse.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/usb/ehci.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index 684da26952f..99dff6f418d 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $NetBSD: ehci.c,v 1.149 2008/10/05 21:31:39 jmcneill Exp $ */ +/* $NetBSD: ehci.c,v 1.150 2008/10/06 02:21:50 jmcneill Exp $ */ /* * Copyright (c) 2004-2008 The NetBSD Foundation, Inc. @@ -52,7 +52,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.149 2008/10/05 21:31:39 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.150 2008/10/06 02:21:50 jmcneill Exp $"); #include "ohci.h" #include "uhci.h" @@ -2828,7 +2828,7 @@ ehci_free_itd(ehci_softc_t *sc, ehci_soft_itd_t *itd) int s; s = splusb(); - LIST_INSERT_AFTER(LIST_FIRST(&sc->sc_freeitds), itd, u.free_list); + LIST_INSERT_HEAD(&sc->sc_freeitds, itd, u.free_list); splx(s); } |
