1
linux/drivers/usb/serial
Alan Stern 8bc2c1b2da usb-serial: change logic of serial lookups
This patch (as1286) changes usb_serial_get_by_index().  Now the
routine will check whether the serial device has been disconnected; if
it has then the return value will be NULL.  If the device hasn't been
disconnected then the routine will return with serial->disc_mutex
held, so that the caller can use the structure without fear of racing
against driver unloads.

This permits the scope of table_mutex in destroy_serial() to be
reduced.  Instead of protecting the entire function, it suffices to
protect the part that actually uses serial_table[], i.e., the call to
return_serial().  There's no longer any danger of the refcount being
incremented after it reaches 0 (which was the reason for having the
large scope previously), because it can't reach 0 until the serial
device has been disconnected.

Also, the patch makes serial_install() check that serial is non-NULL
before attempting to use it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19 13:13:40 -07:00
..
aircable.c USB: usb-serial: replace shutdown with disconnect, release 2009-06-15 21:44:47 -07:00
ark3116.c tty: USB serial termios bits 2009-09-19 13:13:33 -07:00
belkin_sa.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
belkin_sa.h
bus.c USB: usb-serial: call port_probe and port_remove at the right times 2009-06-15 21:44:47 -07:00
ch341.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
ChangeLog.history
console.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
cp210x.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
cyberjack.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
cypress_m8.c tty: USB serial termios bits 2009-09-19 13:13:33 -07:00
cypress_m8.h
digi_acceleport.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
empeg.c tty: USB serial termios bits 2009-09-19 13:13:33 -07:00
ezusb_convert.pl
ezusb.c
ftdi_sio.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
ftdi_sio.h USB: ftdi_sio: add product_id for Marvell OpenRD Base, Client 2009-08-07 16:05:13 -07:00
funsoft.c
garmin_gps.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
generic.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
hp4x.c
io_16654.h
io_edgeport.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
io_edgeport.h
io_ionsp.h
io_tables.h USB: usb-serial: replace shutdown with disconnect, release 2009-06-15 21:44:47 -07:00
io_ti.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
io_ti.h
io_usbvend.h
ipaq.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
ipaq.h
ipw.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
ir-usb.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
iuu_phoenix.c tty: USB serial termios bits 2009-09-19 13:13:33 -07:00
iuu_phoenix.h
Kconfig
keyspan_pda.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
keyspan_usa26msg.h
keyspan_usa28msg.h
keyspan_usa49msg.h
keyspan_usa67msg.h
keyspan_usa90msg.h
keyspan.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
keyspan.h tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
kl5kusb105.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
kl5kusb105.h
kobil_sct.c tty: USB serial termios bits 2009-09-19 13:13:33 -07:00
kobil_sct.h
Makefile
Makefile-keyspan_pda_fw
mct_u232.c tty: USB: serial/mct_u232, fix tty refcnt 2009-09-19 13:13:37 -07:00
mct_u232.h
mos7720.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
mos7840.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
moto_modem.c
navman.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
omninet.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
opticon.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
option.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
oti6858.c tty: USB serial termios bits 2009-09-19 13:13:33 -07:00
oti6858.h
pl2303.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
pl2303.h USB: pl2303: New vendor and product id 2009-08-07 16:05:12 -07:00
qcserial.c
safe_serial.c
siemens_mpi.c
sierra.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
spcp8x5.c tty: USB serial termios bits 2009-09-19 13:13:33 -07:00
symbolserial.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
ti_usb_3410_5052.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
ti_usb_3410_5052.h
usb_debug.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
usb-serial.c usb-serial: change logic of serial lookups 2009-09-19 13:13:40 -07:00
visor.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
visor.h
whiteheat.c tty: USB serial termios bits 2009-09-19 13:13:33 -07:00
whiteheat.h