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.
This commit is contained in:
hm 2001-05-21 09:24:48 +00:00
parent c65c10ec83
commit 39cf58d369

View File

@ -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;