Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Add some sanity checks.



details:   https://anonhg.NetBSD.org/src/rev/1b78704775e9
branches:  trunk
changeset: 474423:1b78704775e9
user:      augustss <augustss%NetBSD.org@localhost>
date:      Tue Jul 06 07:12:03 1999 +0000

description:
Add some sanity checks.

diffstat:

 sys/dev/usb/usbdi.c |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (36 lines):

diff -r 210f9a0b9706 -r 1b78704775e9 sys/dev/usb/usbdi.c
--- a/sys/dev/usb/usbdi.c       Tue Jul 06 06:10:53 1999 +0000
+++ b/sys/dev/usb/usbdi.c       Tue Jul 06 07:12:03 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdi.c,v 1.25 1999/06/30 06:44:23 augustss Exp $      */
+/*     $NetBSD: usbdi.c,v 1.26 1999/07/06 07:12:03 augustss Exp $      */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -191,6 +191,13 @@
 usbd_close_pipe(pipe)
        usbd_pipe_handle pipe;
 {
+#ifdef DIAGNOSTIC
+       if (pipe == 0) {
+               printf("usbd_close_pipe: pipe==NULL\n");
+               return (USBD_NORMAL_COMPLETION);
+       }
+#endif
+
        if (--pipe->refcnt != 0)
                return (USBD_NORMAL_COMPLETION);
        if (SIMPLEQ_FIRST(&pipe->queue) != 0)
@@ -359,6 +366,12 @@
        usbd_status r;
        int s;
 
+#ifdef DIAGNOSTIC
+       if (pipe == 0) {
+               printf("usbd_close_pipe: pipe==NULL\n");
+               return (USBD_NORMAL_COMPLETION);
+       }
+#endif
        s = splusb();
        r = usbd_ar_pipe(pipe);
        splx(s);



Home | Main Index | Thread Index | Old Index