From 39cf58d369279eaf1d11a706f174fdb98fb245e8 Mon Sep 17 00:00:00 2001 From: hm Date: Mon, 21 May 2001 09:24:48 +0000 Subject: Submitted by: Juha-Matti Liukkonen, Cubical Solutions Ltd (jml@cubical.fi) Reviewed by: hm Bug in i4btel driver read routine corrected. The conditions in the while() clause caused the receive queue to be referenced before checking if a channel is connected, leading to kernel panic (do a 'dd if=/dev/i4btel0 of=/dev/null' on an unconnected tel device, panic will follow). Correction was to reorder the while clause conditions to check for connectedness first. --- sys/i4b/driver/i4b_tel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/i4b') diff --git a/sys/i4b/driver/i4b_tel.c b/sys/i4b/driver/i4b_tel.c index 48ddb55..2b6115b 100644 --- a/sys/i4b/driver/i4b_tel.c +++ b/sys/i4b/driver/i4b_tel.c @@ -29,7 +29,7 @@ * * $FreeBSD$ * - * last edit-date: [Fri Jan 12 14:52:05 2001] + * last edit-date: [Tue May 8 10:19:36 2001] * *---------------------------------------------------------------------------*/ @@ -533,9 +533,9 @@ i4btelread(dev_t dev, struct uio *uio, int ioflag) s = splimp(); IF_LOCK(sc->isdn_linktab->rx_queue); - while(IF_QEMPTY(sc->isdn_linktab->rx_queue) && - (sc->devstate & ST_ISOPEN) && - (sc->devstate & ST_CONNECTED)) + while((sc->devstate & ST_ISOPEN) && + (sc->devstate & ST_CONNECTED) && + IF_QEMPTY(sc->isdn_linktab->rx_queue)) { sc->devstate |= ST_RDWAITDATA; -- cgit v1.1