opnsense-src/sys/dev/usb
Warner Losh 5acfdb129b Starting in version 1.56, ucomstop started calling ucomstart to work
around an output freezing problem (see the CVS log for details).  This
is the same approach that sio takes to solve that problem.  However,
ucom has a problem that sio doesn't have.

Consider the case where output is pending, and the device is closed.
ttyclose calls tt_close (which indirects to ucomclose) and then calls
ttyflush which calls tt_stop (which indirects to ucomstop).  Since
ucomclose removed all the usb transfer points, sc_oxfer will be NULL
when ucomstop calls ucomstart.  This results in a null pointer
dereference.

Since calling ucomstart in ucomstart solves other problems, we need to
work with this calling sequence.  The easiest way to do that is to
bail early if sc_oxfer is NULL.

Kazuaki ODA-san came up with this patch, and filed a PR.  I had seen
this bug at work and this patch does seem to solve it.  He had no idea
why it worked, but knew that either this patch, or backing out ucom.c
1.56 fixed his panic.  I just did the legwork of chasing down the code
paths that would cause this, and added a comment.  This is obscure
enough to warrant a comment, I think.

Submitted by: Kazuaki ODA-san
PR: 113964
Approved by: re (bmah)
2007-06-25 06:40:20 +00:00
..
dsbr100io.h Don't pretend to support !BSD systems. 2007-06-12 19:01:32 +00:00
ehci.c s/logprintf/printf/g 2007-06-20 05:11:37 +00:00
ehci_pci.c Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
ehcireg.h ehcivar.h: 2005-09-18 11:45:39 +00:00
ehcivar.h Expand callout compatibility macros in the main usb bridges. 2007-06-14 16:23:31 +00:00
FILES Acknowledge (dearly) departed files 2006-11-21 22:29:06 +00:00
hid.c s/logprintf/printf/g 2007-06-20 05:11:37 +00:00
hid.h Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
if_aue.c Remove duplicate ID and recall that I comes after E in alphabetical 2007-06-23 05:59:53 +00:00
if_auereg.h Remove my "custom" locks that allow for lock acquire abort, they are 2007-01-08 23:24:21 +00:00
if_axe.c Use device_foo_t to declare kobj methods 2007-06-18 22:25:46 +00:00
if_axereg.h Prefer device_printf over printf. Eliminate axe_unit as it is no 2007-06-10 07:24:32 +00:00
if_cdce.c Add a boatload of devices from OpenBSD and NetBSD to kue and cdce. 2007-06-23 06:47:43 +00:00
if_cdcereg.h Prefer device_printf over printf 2007-06-10 07:33:48 +00:00
if_cue.c Note the Belkin F5U111 Adapter is covered by NETMATE entry. 2007-06-23 06:29:19 +00:00
if_cuereg.h Prefer device_printf to printf where sane. 2007-06-11 05:42:47 +00:00
if_kue.c Add a boatload of devices from OpenBSD and NetBSD to kue and cdce. 2007-06-23 06:47:43 +00:00
if_kuereg.h Prefer device_printf to printf 2007-06-11 05:50:47 +00:00
if_rue.c s/logprintf/printf/g 2007-06-20 05:11:37 +00:00
if_ruereg.h Remove compat ifdefs for FreeBSD versions < 500014, makes the code 2007-05-12 05:53:53 +00:00
if_rum.c Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
if_rumreg.h Update 802.11 wireless support: 2007-06-11 03:36:55 +00:00
if_rumvar.h Update 802.11 wireless support: 2007-06-11 03:36:55 +00:00
if_udav.c s/logprintf/printf/g 2007-06-20 05:11:37 +00:00
if_udavreg.h More removing compatibility macros. 2006-09-07 00:06:42 +00:00
if_ural.c Drag in another device: The Surecom RT2570. 2007-06-23 06:52:56 +00:00
if_uralreg.h Update 802.11 wireless support: 2007-06-11 03:36:55 +00:00
if_uralvar.h Update 802.11 wireless support: 2007-06-11 03:36:55 +00:00
kue_fw.h s/Static/static/g 2006-09-06 23:44:25 +00:00
ohci.c s/logprintf/printf/g 2007-06-20 05:11:37 +00:00
ohci_pci.c Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
ohcireg.h Use the limited scatter-gather capabilities of ehci, ohci and uhci 2006-05-28 05:27:09 +00:00
ohcivar.h Expand callout compatibility macros in the main usb bridges. 2007-06-14 16:23:31 +00:00
rio500_usb.h Don't pretend to support !BSD systems. 2007-06-12 19:01:32 +00:00
rt2573_ucode.h Add support for Ralink Technology RT2501USB/RT2601USB devices. 2007-05-06 10:07:21 +00:00
sl811hs.c Include usb_port.h to fix build. 2007-06-19 10:28:08 +00:00
sl811hsreg.h Add SL811 based host controller driver for CF usb host controller. 2005-07-14 15:57:01 +00:00
sl811hsvar.h Use pause() rather than using tsleep() on a dummy variable. 2007-02-27 17:19:33 +00:00
slhci_pccard.c Include usb_port.h to fix build. 2007-06-19 10:28:08 +00:00
uark.c s/logprintf/printf/g 2007-06-20 05:11:37 +00:00
ubsa.c add support for Option GlobeTrotter 3G+ 2007-06-22 05:56:05 +00:00
ubser.c Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
ubser.h initialize pp->p_sc so it can be referenced later. 2005-03-17 22:47:18 +00:00
ucom.c Starting in version 1.56, ucomstop started calling ucomstart to work 2007-06-25 06:40:20 +00:00
ucomvar.h Eliminate usb_thread_t. 2007-06-12 17:30:54 +00:00
ucycom.c Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
udbp.c USL101 Host-to-Host bridge support 2007-06-22 05:14:27 +00:00
udbp.h Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
ufm.c Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
ufoma.c Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
uftdi.c Tactrix Openport support 2007-06-22 05:53:05 +00:00
uftdireg.h Add support to the uftdi driver for Intrepid Control Systems' vehicle 2004-07-01 17:16:20 +00:00
ugen.c Remove devinfo junk. 2007-06-09 06:42:19 +00:00
ugraphire_rdesc.h Add support for the Wacom Graphire 3 4x5. Like the Graphire 3, it has a 2005-12-31 04:38:50 +00:00
uhci.c Expand callout compatibility macros in the main usb bridges. 2007-06-14 16:23:31 +00:00
uhci_pci.c Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
uhcireg.h Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
uhcivar.h Expand callout compatibility macros in the main usb bridges. 2007-06-14 16:23:31 +00:00
uhid.c Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
uhub.c Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
uipaq.c Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
ukbd.c We need a special module loader routine, not the stock usbd one. This 2007-06-23 04:20:24 +00:00
ulpt.c Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
umass.c Add support for YANO external USB-HDD. 2007-06-21 20:13:07 +00:00
umct.c Finish removal of usb_port.h macros. 2007-06-18 22:27:57 +00:00
umodem.c Initialize id before using it. 2007-06-23 04:18:44 +00:00
ums.c Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
uplcom.c s/logprintf/printf/g 2007-06-20 05:11:37 +00:00
urio.c Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
usb.c s/logprintf/printf/g 2007-06-20 05:11:37 +00:00
usb.h Remove usb_port.h from usb.h, except for one or two useful things that 2007-06-18 22:30:53 +00:00
usb_ethersubr.c Add the following functions to abstract away the creation of task threads 2007-01-08 23:21:06 +00:00
usb_ethersubr.h Add the following functions to abstract away the creation of task threads 2007-01-08 23:21:06 +00:00
usb_if.m Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
usb_mem.c s/logprintf/printf/g 2007-06-20 05:11:37 +00:00
usb_mem.h Remove more __OtherBSD__ ifdefs that don't make sense, and haven't for 2007-06-13 05:45:48 +00:00
usb_port.h Restore approximately FreeBDS 6.x's level of compatibility macros. 2007-06-21 14:36:22 +00:00
usb_quirks.c Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
usb_quirks.h Latest round of usb cleanups: 2007-06-21 14:42:34 +00:00
usb_subr.c s/logprintf/printf/g 2007-06-20 05:11:37 +00:00
usbcdc.h Sync with 1.9 from NetBSD, this includes: 2005-03-01 06:35:04 +00:00
usbdevs For USBVERBOSE case, we can't have " in any of the names. 2007-06-23 16:50:46 +00:00
usbdi.c s/logprintf/printf/g 2007-06-20 05:11:37 +00:00
usbdi.h First pass at removing __OtherBSD__. We can't blindly remove all of 2007-06-12 19:40:20 +00:00
usbdi_util.c s/logprintf/printf/g 2007-06-20 05:11:37 +00:00
usbdi_util.h protect against multiple inclusion (this is useful when you 2007-01-03 10:50:03 +00:00
usbdivar.h Expand callout compatibility macros in the main usb bridges. 2007-06-14 16:23:31 +00:00
usbhid.h Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
uscanner.c add Benq 3300U/4300U support 2007-06-22 05:49:12 +00:00
uvisor.c Add support for Garmin iQue 3600 2007-06-22 06:02:19 +00:00
uvscom.c s/logprintf/printf/g 2007-06-20 05:11:37 +00:00
uxb360gp_rdesc.h Add support for the Wacom Graphire 3 4x5. Like the Graphire 3, it has a 2005-12-31 04:38:50 +00:00