Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sh5/dev In scif_rxsoft, bail early if the input buf...



details:   https://anonhg.NetBSD.org/src/rev/f269e90a631c
branches:  trunk
changeset: 555129:f269e90a631c
user:      scw <scw%NetBSD.org@localhost>
date:      Sun Nov 09 12:19:54 2003 +0000

description:
In scif_rxsoft, bail early if the input buffers have not been initialised yet.
This can happen if we drop into ddb on the serial console before
scif_attach() has been called.

diffstat:

 sys/arch/sh5/dev/scif.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 78c8dba4d081 -r f269e90a631c sys/arch/sh5/dev/scif.c
--- a/sys/arch/sh5/dev/scif.c   Sun Nov 09 11:50:59 2003 +0000
+++ b/sys/arch/sh5/dev/scif.c   Sun Nov 09 12:19:54 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scif.c,v 1.12 2003/08/07 16:29:30 agc Exp $    */
+/*     $NetBSD: scif.c,v 1.13 2003/11/09 12:19:54 scw Exp $    */
 
 /*-
  * Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu.  All rights reserved.
@@ -106,7 +106,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.12 2003/08/07 16:29:30 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.13 2003/11/09 12:19:54 scw Exp $");
 
 #include "opt_kgdb.h"
 
@@ -1075,6 +1075,10 @@
 
        end = sc->sc_ebuf;
        get = sc->sc_rbget;
+
+       if (end == NULL || get == NULL)
+               return;
+
        scc = cc = scif_rbuf_size - sc->sc_rbavail;
 
        if (cc == scif_rbuf_size) {



Home | Main Index | Thread Index | Old Index