Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/sys/dev/usb Pull up following revision(s) (requested by d...



details:   https://anonhg.NetBSD.org/src/rev/30b3d3cd8c8c
branches:  netbsd-3
changeset: 577897:30b3d3cd8c8c
user:      riz <riz%NetBSD.org@localhost>
date:      Fri Mar 24 22:35:33 2006 +0000

description:
Pull up following revision(s) (requested by drochner in ticket #1215):
        sys/dev/usb/usb.c: revision 1.83
Allow a NULL pointer as argument to usb_get_next_event(), and don't
allocate a "struct usb_event" on stack in usb_add_event().
This gives just enough breathing space that the box doesn't die
immediately from stack overflow when I insert a
ohci0 at cardbus0 dev 0 function 0: Acer Labs M5237 USB 1.1 Host Controller

diffstat:

 sys/dev/usb/usb.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 080f70f140ce -r 30b3d3cd8c8c sys/dev/usb/usb.c
--- a/sys/dev/usb/usb.c Fri Mar 24 22:31:52 2006 +0000
+++ b/sys/dev/usb/usb.c Fri Mar 24 22:35:33 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb.c,v 1.81 2005/01/24 01:30:38 joff Exp $    */
+/*     $NetBSD: usb.c,v 1.81.6.1 2006/03/24 22:35:33 riz Exp $ */
 
 /*
  * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.81 2005/01/24 01:30:38 joff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.81.6.1 2006/03/24 22:35:33 riz Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -703,7 +703,8 @@
                return (0);
        }
 #endif
-       *ue = ueq->ue;
+       if (ue)
+               *ue = ueq->ue;
        SIMPLEQ_REMOVE_HEAD(&usb_events, next);
        free(ueq, M_USBDEV);
        usb_nevents--;
@@ -734,7 +735,6 @@
 usb_add_event(int type, struct usb_event *uep)
 {
        struct usb_event_q *ueq;
-       struct usb_event ue;
        struct timeval thetime;
        int s;
 
@@ -749,7 +749,7 @@
        if (++usb_nevents >= USB_MAX_EVENTS) {
                /* Too many queued events, drop an old one. */
                DPRINTFN(-1,("usb: event dropped\n"));
-               (void)usb_get_next_event(&ue);
+               (void)usb_get_next_event(0);
        }
        SIMPLEQ_INSERT_TAIL(&usb_events, ueq, next);
        wakeup(&usb_events);



Home | Main Index | Thread Index | Old Index