From 3841bf81f7129a7f86d673f4a02ffc53f8385e4b Mon Sep 17 00:00:00 2001 From: Brian Feldman Date: Wed, 15 Mar 2000 03:23:04 +0000 Subject: [PATCH] I _HATE_ crashes. The lptread() call needs to check LP_BYPASS, because if one tries to use read() on an LP_BYPASS'd dev_t, the softc will be initialized mainly with NULLs, so... --- sys/dev/ppbus/lpt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c index b83cc03474f4..a7f8dd97767e 100644 --- a/sys/dev/ppbus/lpt.c +++ b/sys/dev/ppbus/lpt.c @@ -695,6 +695,11 @@ lptread(dev_t dev, struct uio *uio, int ioflag) device_t ppbus = device_get_parent(lptdev); int error = 0, len; + if (sc->sc_flags & LP_BYPASS) { + /* we can't do reads in bypass mode */ + return (EPERM); + } + if ((error = ppb_1284_negociate(ppbus, PPB_NIBBLE, 0))) return (error);