summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1998-03-18 20:52:28 +0000
committerdg <dg@FreeBSD.org>1998-03-18 20:52:28 +0000
commit12550f787500bd4ce7e933932ca2e3e0bebbd1be (patch)
treebeab4b2c369de97ef78e58ce622a13f17d2c8e7b
parente46f4af1d6a80dcb6076cea2f43bf2b2ffa2e53e (diff)
downloadFreeBSD-src-12550f787500bd4ce7e933932ca2e3e0bebbd1be.zip
FreeBSD-src-12550f787500bd4ce7e933932ca2e3e0bebbd1be.tar.gz
Protect against count of chars received being 0, which causes a panic
otherwise. Can apparantly happen with some firmware revs. Submitted by: Kouichi Hirabayashi <kh@mogami-wire.co.jp>
-rw-r--r--sys/dev/cy/cy.c4
-rw-r--r--sys/dev/cy/cy_isa.c4
-rw-r--r--sys/i386/isa/cy.c4
3 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index 8661f3e..5dd4762 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.60 1998/01/24 02:54:17 eivind Exp $
+ * $Id: cy.c,v 1.61 1998/02/13 12:45:47 phk Exp $
*/
#include "opt_compat.h"
@@ -1122,6 +1122,8 @@ siointr(unit)
int ifree;
count = cd_inb(iobase, CD1400_RDCR, cy_align);
+ if (!count)
+ goto cont;
com->bytes_in += count;
ioptr = com->iptr;
ifree = com->ibufend - ioptr;
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index 8661f3e..5dd4762 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.60 1998/01/24 02:54:17 eivind Exp $
+ * $Id: cy.c,v 1.61 1998/02/13 12:45:47 phk Exp $
*/
#include "opt_compat.h"
@@ -1122,6 +1122,8 @@ siointr(unit)
int ifree;
count = cd_inb(iobase, CD1400_RDCR, cy_align);
+ if (!count)
+ goto cont;
com->bytes_in += count;
ioptr = com->iptr;
ifree = com->ibufend - ioptr;
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c
index 8661f3e..5dd4762 100644
--- a/sys/i386/isa/cy.c
+++ b/sys/i386/isa/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.60 1998/01/24 02:54:17 eivind Exp $
+ * $Id: cy.c,v 1.61 1998/02/13 12:45:47 phk Exp $
*/
#include "opt_compat.h"
@@ -1122,6 +1122,8 @@ siointr(unit)
int ifree;
count = cd_inb(iobase, CD1400_RDCR, cy_align);
+ if (!count)
+ goto cont;
com->bytes_in += count;
ioptr = com->iptr;
ifree = com->ibufend - ioptr;
OpenPOWER on IntegriCloud