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...
This commit is contained in:
green 2000-03-15 03:23:04 +00:00
parent a18025220f
commit 00e431ccd7

View File

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