diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2000-11-07 10:50:34 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2000-11-07 10:50:34 +0000 |
commit | a08e403bc2a29d35eb637c8946cd8d06252679a2 (patch) | |
tree | 1b3130fc07f784ff78aff8c418daaaa122fc306d /sys/dev/usb | |
parent | 3bd5d69a0a03782a353221d795fd2b25c9c62aa1 (diff) | |
download | FreeBSD-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.c | 5 |
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); |