From 238c341979d41f14ef11ade7837e54148a321ab0 Mon Sep 17 00:00:00 2001 From: Marcus Glocker Date: Tue, 7 Oct 2008 11:31:10 +0000 Subject: In ehci_free_itd() replace LIST_INSERT_AFTER(LIST_FIRST(..), ..) with LIST_INSERT_HEAD(..) to prevent a crash when the freelist is empty. From NetBSD. --- sys/dev/usb/ehci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/usb') diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index 618ed31d024..d7ae109d0de 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ehci.c,v 1.93 2008/10/06 20:18:56 mglocker Exp $ */ +/* $OpenBSD: ehci.c,v 1.94 2008/10/07 11:31:09 mglocker Exp $ */ /* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */ /* @@ -2675,7 +2675,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); } -- cgit v1.2.3