Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb fix some bugs (by kay%kaynet.or.jp@localhost):



details:   https://anonhg.NetBSD.org/src/rev/4d4b8f3e9524
branches:  trunk
changeset: 533029:4d4b8f3e9524
user:      tshiozak <tshiozak%NetBSD.org@localhost>
date:      Wed Jun 19 13:51:34 2002 +0000

description:
fix some bugs (by kay%kaynet.or.jp@localhost):
  - compile error with debug option,
  - miss of cut and paste, and
  - logical error on resource freeing.

diffstat:

 sys/dev/usb/umidi.c |  24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diffs (67 lines):

diff -r 9f75386473ff -r 4d4b8f3e9524 sys/dev/usb/umidi.c
--- a/sys/dev/usb/umidi.c       Wed Jun 19 11:44:26 2002 +0000
+++ b/sys/dev/usb/umidi.c       Wed Jun 19 13:51:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umidi.c,v 1.14 2002/03/08 17:24:06 kent Exp $  */
+/*     $NetBSD: umidi.c,v 1.15 2002/06/19 13:51:34 tshiozak Exp $      */
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.14 2002/03/08 17:24:06 kent Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.15 2002/06/19 13:51:34 tshiozak Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -810,9 +810,9 @@
 static void
 unbind_jacks_from_mididev(struct umidi_mididev *mididev)
 {
-       if ((mididev->flags&FWRITE) && mididev->out_jack)
+       if ((mididev->flags & FWRITE) && mididev->out_jack)
                close_out_jack(mididev->out_jack);
-       if ((mididev->flags&FWRITE) && mididev->in_jack)
+       if ((mididev->flags & FREAD) && mididev->in_jack)
                close_in_jack(mididev->in_jack);
 
        if (mididev->out_jack)
@@ -906,8 +906,14 @@
 
        if (jack->opened) {
                s = splusb();
-               LIST_REMOVE(jack, u.out.queue_entry);
-               if (jack==jack->endpoint->queue_tail) {
+               LIST_FOREACH(tail,
+                            &jack->endpoint->queue_head,
+                            u.out.queue_entry)
+                       if (tail == jack) {
+                               LIST_REMOVE(jack, u.out.queue_entry);
+                               break;
+                       }
+               if (jack == jack->endpoint->queue_tail) {
                        /* find tail */
                        LIST_FOREACH(tail,
                                     &jack->endpoint->queue_head,
@@ -1073,8 +1079,8 @@
 static void
 dump_jack(struct umidi_jack *jack)
 {
-       DPRINTFN(10, ("\t\t\tep=%p, mididev=%p\n",
-                     jack->endpoint, jack->mididev));
+       DPRINTFN(10, ("\t\t\tep=%p\n",
+                     jack->endpoint));
 }
 
 #endif /* UMIDI_DEBUG */
@@ -1241,7 +1247,7 @@
        }
        if (!jack->binded || !jack->opened)
                return;
-       DPR_PACKET(in, ep->sc, &jack->buffer);
+       DPR_PACKET(in, ep->sc, &jack->packet);
        if (jack->u.in.intr) {
                for (i=0; i<len; i++) {
                        (*jack->u.in.intr)(jack->arg, ep->buffer[i+1]);



Home | Main Index | Thread Index | Old Index