summaryrefslogtreecommitdiffstats
path: root/sys/dev/ppbus
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2000-03-15 03:23:04 +0000
committergreen <green@FreeBSD.org>2000-03-15 03:23:04 +0000
commit00e431ccd775f83654f49e976c9478ddbb2e8931 (patch)
tree4a880d478321e5a9efbd62a07ee8619f49e6ee3a /sys/dev/ppbus
parenta18025220fb4314f187c289612aa5f475f226306 (diff)
downloadFreeBSD-src-00e431ccd775f83654f49e976c9478ddbb2e8931.zip
FreeBSD-src-00e431ccd775f83654f49e976c9478ddbb2e8931.tar.gz
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...
Diffstat (limited to 'sys/dev/ppbus')
-rw-r--r--sys/dev/ppbus/lpt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c
index b83cc03..a7f8dd9 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);
OpenPOWER on IntegriCloud