summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>2000-11-07 10:50:34 +0000
committern_hibma <n_hibma@FreeBSD.org>2000-11-07 10:50:34 +0000
commita08e403bc2a29d35eb637c8946cd8d06252679a2 (patch)
tree1b3130fc07f784ff78aff8c418daaaa122fc306d /sys/dev/usb
parent3bd5d69a0a03782a353221d795fd2b25c9c62aa1 (diff)
downloadFreeBSD-src-a08e403bc2a29d35eb637c8946cd8d06252679a2.zip
FreeBSD-src-a08e403bc2a29d35eb637c8946cd8d06252679a2.tar.gz
Fix for powering off a HP DJ950C during printing. As stated by Ian:
When the printer is turned off the pipe write will cause and error, which causes lpd to close the device and reopen it to clear the error. After a short while the device will disappear from the bus but lpd will have opened the ulpt0 port by then. ulpt_status will check for status without checking the sc->dying flag and panic the kernel when the device finally disappears from the bus. Submitted by: Ian Dowse <iedowse@maths.tcd.ie>
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/ulpt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c
index e5193c9..78eb779 100644
--- a/sys/dev/usb/ulpt.c
+++ b/sys/dev/usb/ulpt.c
@@ -427,6 +427,11 @@ ulptopen(dev, flag, mode, p)
sc->sc_state = 0;
return (error);
}
+
+ if (sc->sc_dying) {
+ sc->sc_state = 0;
+ return (ENXIO);
+ }
}
err = usbd_open_pipe(sc->sc_iface, sc->sc_bulk, 0, &sc->sc_bulkpipe);
OpenPOWER on IntegriCloud