Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Prevent possible wayward loop.



details:   https://anonhg.NetBSD.org/src/rev/30fa5be1bbf3
branches:  trunk
changeset: 481263:30fa5be1bbf3
user:      pk <pk%NetBSD.org@localhost>
date:      Tue Jan 25 09:30:00 2000 +0000

description:
Prevent possible wayward loop.

diffstat:

 sys/dev/ic/ncr53c9x.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r b8f1d38b5276 -r 30fa5be1bbf3 sys/dev/ic/ncr53c9x.c
--- a/sys/dev/ic/ncr53c9x.c     Tue Jan 25 09:23:59 2000 +0000
+++ b/sys/dev/ic/ncr53c9x.c     Tue Jan 25 09:30:00 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ncr53c9x.c,v 1.39 1999/11/10 05:02:53 mycroft Exp $    */
+/*     $NetBSD: ncr53c9x.c,v 1.40 2000/01/25 09:30:00 pk Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -1929,9 +1929,10 @@
                        }
                        if ((NCR_READ_REG(sc, NCR_FFLAG)
                            & NCRFIFO_FF) != 2) {
+                               /* Drop excess bytes from the queue */
                                int i = (NCR_READ_REG(sc, NCR_FFLAG)
                                            & NCRFIFO_FF) - 2;
-                               while (i--)
+                               while (i-- > 0)
                                        (void) NCR_READ_REG(sc, NCR_FIFO);
                        }
                        ecb->stat = NCR_READ_REG(sc, NCR_FIFO);



Home | Main Index | Thread Index | Old Index