linux/drivers/usb/serial
Andy Green e48eb085ac USB: belkin_sa: avoid divide by zero error
The belkin_sa module has a problem coping with a 0 return from
tty_get_baud_rate() -- the subsequent BELKIN_SA_BAUD macro

drivers/usb/serial/belkin_sa.h:#define BELKIN_SA_BAUD(b) (230400/b)

performs a divide with it leading to the following divide error:

usb 3-1: Belkin / Peracom / GoHubs USB Serial Adapter converter now attached to ttyUSB0
PM: Adding info for No Bus:usbdev3.3_ep81
PM: Adding info for No Bus:usbdev3.3_ep01
PM: Adding info for No Bus:usbdev3.3_ep82
divide error: 0000 [#1]
SMP
Modules linked in: vfat fat iwl3945 mac80211 cfg80211 belkin_sa usbserial usb_storage autofs4 vmnet(P) vmmon(P) aes nf_conntrack_netbios_ns ipt_REJECT nf_conntrack_ipv4 xt_state nf_conntrack nfnetlink xt_tcpudp iptable_filter ip_tables x_tables cpufreq_ondemand acpi_cpufreq video output sbs button dock battery ac arc4 snd_hda_intel ecb blkcipher snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss sr_mod snd_mixer_oss rtc_cmos cdrom iTCO_wdt iTCO_vendor_support snd_pcm rtc_core snd_timer serio_raw b44 ssb rtc_lib parport ata_piix snd soundcore snd_page_alloc mii ata_generic sg ahci libata sd_mod scsi_mod ext3 jbd mbcache ehci_hcd ohci_hcd uhci_hcd
CPU:    1
EIP:    0060:[<f8dd1747>]    Tainted: P        VLI
EFLAGS: 00010246   (2.6.23-rc1 #1)
EIP is at belkin_sa_set_termios+0x18e/0x5b9 [belkin_sa]
eax: 00038400   ebx: 00000000   ecx: 00000000   edx: 00000000
esi: 00038400   edi: 00001cb2   ebp: de49adb0   esp: de49ad6c
ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068
Process minicom (pid: 7306, ti=de49a000 task=eed6c3b0 task.ti=de49a000)
Stack: d85c74f0 00000046 00000002 00000001 d85c74f0 d85c74f0 00000246 c887c658
       00000001 00000cb0 00000001 00000084 00000000 d01b58c0 f6ba10e0 de49ade8
       de49ae40 de49add0 f8e2526b d85c74b8 ca6e6dbc de49ae40 d85c746c eded72e8
Call Trace:
 [<c0405f35>] show_trace_log_lvl+0x1a/0x2f
 [<c0405fe5>] show_stack_log_lvl+0x9b/0xa3
 [<c04061a5>] show_registers+0x1b8/0x289
 [<c0406389>] die+0x113/0x246
 [<c0622f98>] do_trap+0x8a/0xa3
 [<c04068dc>] do_divide_error+0x85/0x8f
 [<c0622d6a>] error_code+0x72/0x78
 [<f8e2526b>] serial_set_termios+0x86/0x8d [usbserial]
 [<c0542d33>] set_termios+0x309/0x34c
 [<c0542ece>] n_tty_ioctl+0x158/0x4ba
 [<c054030b>] tty_ioctl+0xc78/0xcd6
 [<c048aea0>] do_ioctl+0x50/0x67
 [<c048b100>] vfs_ioctl+0x249/0x25c
 [<c048b15c>] sys_ioctl+0x49/0x61
 [<c0404ed2>] sysenter_past_esp+0x5f/0x99
 =======================
Code: 85 c0 79 14 c7 44 24 04 67 1c dd f8 c7 04 24 d4 1e dd f8 e8 96 99 65 c7 8b 46 04 be 00 84 03 00 e8 47 11 77 c7 31 d2 89 c1 89 f0 <f7> f1 66 85 c0 89 c1 b8 01 00 00 00 0f 44 c8 8b 45 d8 85 db 8b
EIP: [<f8dd1747>] belkin_sa_set_termios+0x18e/0x5b9 [belkin_sa] SS:ESP 0068:de49ad6c

The small patch below should take care of this situation.  Note that my
kernel was tainted (vmware) but the problem will occur if
tty_get_baud_rate() ever returns zero and should be taken care of.

Signed-off-by: Andy Green <andy@warmcat.com>
Cc: William Greathouse <wgreathouse@smva.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: stable <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-08-22 14:27:46 -07:00
..
aircable.c USB: serial: aircable: clean up urb->status usage 2007-07-12 16:34:31 -07:00
airprime.c USB: fix support for Dell Wireless Broadband (aka WWAN) 2007-08-22 14:27:44 -07:00
ark3116.c USB: serial: ark3116.c: Mixed fixups 2007-07-12 16:34:37 -07:00
belkin_sa.c USB: belkin_sa: avoid divide by zero error 2007-08-22 14:27:46 -07:00
belkin_sa.h
bus.c USB serial: add dynamic id support to usb-serial core 2007-02-07 15:44:33 -08:00
ChangeLog.history
console.c [PATCH] tty: switch to ktermios 2006-12-08 08:28:57 -08:00
cp2101.c cp2101: Remove broken termios optimisation, use proper speed API 2007-07-30 13:27:45 -07:00
cyberjack.c USB: serial: cyberjack: clean up urb->status usage 2007-07-12 16:34:32 -07:00
cypress_m8.c USB: serial: cypress_m8: clean up urb->status usage 2007-07-12 16:34:32 -07:00
cypress_m8.h [PATCH] USB: cypress_m8: add support for the Nokia ca42-version 2 cable 2006-03-20 14:50:00 -08:00
digi_acceleport.c digi_acceleport: Drag the driver kicking and screaming into coding style 2007-07-30 13:27:46 -07:00
empeg.c USB: serial: empeg: clean up urb->status usage 2007-07-12 16:34:32 -07:00
ezusb_convert.pl
ezusb.c USB: kmemdup() cleanup in drivers/usb/ 2006-12-01 14:23:27 -08:00
ftdi_sio.c USB: Support for the Evolution Scorpion robots 2007-08-22 14:27:46 -07:00
ftdi_sio.h USB: Support for the Evolution Scorpion robots 2007-08-22 14:27:46 -07:00
funsoft.c USB serial: add driver pointer to all usb-serial drivers 2007-02-07 15:44:34 -08:00
garmin_gps.c USB: serial: garmin_gps: fixes package loss if used from gpsbabel 2007-08-22 14:27:44 -07:00
generic.c USB: serial: generic: clean up urb->status usage 2007-07-12 16:34:33 -07:00
hp4x.c USB serial: add driver pointer to all usb-serial drivers 2007-02-07 15:44:34 -08:00
io_16654.h
io_edgeport.c usb-serial: Fix edgeport regression on non-EPiC devices 2007-07-30 13:27:47 -07:00
io_edgeport.h USB: io_edgeport: Convert to generic boolean 2007-04-27 13:28:36 -07:00
io_fw_boot2.h
io_fw_boot.h
io_fw_down2.h
io_fw_down3.h USB: io_ti: Digi EdgePort update for new devices 2007-07-12 16:29:48 -07:00
io_fw_down.h
io_ionsp.h
io_tables.h USB serial: add driver pointer to all usb-serial drivers 2007-02-07 15:44:34 -08:00
io_ti.c USB: Remove pointless conditional in drivers/usb/serial/io_ti.c::edge_shutdown() 2007-07-19 17:46:05 -07:00
io_ti.h
io_usbvend.h USB: io_ti: Digi EdgePort update for new devices 2007-07-12 16:29:48 -07:00
ipaq.c USB: serial: ipaq: clean up urb->status usage 2007-07-12 16:34:33 -07:00
ipaq.h
ipw.c USB: serial: ipw: clean up urb->status usage 2007-07-12 16:34:33 -07:00
ir-usb.c USB: serial: ir_usb: Clean up the worst of it, remove exciting 'crash on open' feature 2007-07-12 16:34:37 -07:00
Kconfig USB: oti6858 usb-serial driver (in Nokia CA-42 cable) 2007-07-12 16:29:47 -07:00
keyspan_mpr_fw.h
keyspan_pda_fw.h
keyspan_pda.c USB: serial: keyspan_pda: clean up urb->status usage 2007-07-12 16:34:35 -07:00
keyspan_pda.S
keyspan_usa18x_fw.h
keyspan_usa19_fw.h
keyspan_usa19qi_fw.h
keyspan_usa19qw_fw.h
keyspan_usa19w_fw.h
keyspan_usa26msg.h
keyspan_usa28_fw.h
keyspan_usa28msg.h
keyspan_usa28x_fw.h
keyspan_usa28xa_fw.h
keyspan_usa28xb_fw.h
keyspan_usa49msg.h
keyspan_usa49w_fw.h
keyspan_usa49wlc_fw.h
keyspan_usa67msg.h USB Serial Keyspan: add support for USA-49WG & USA-28XG 2007-07-12 16:29:45 -07:00
keyspan_usa90msg.h
keyspan.c USB: serial: keyspan: clean up urb->status usage 2007-07-12 16:34:35 -07:00
keyspan.h USB Serial Keyspan: add support for USA-49WG & USA-28XG 2007-07-12 16:29:45 -07:00
kl5kusb105.c USB: serial: kl5kusb105: clean up urb->status usage 2007-07-12 16:34:35 -07:00
kl5kusb105.h
kobil_sct.c USB: serial: kobil_sct: clean up urb->status usage 2007-07-12 16:34:35 -07:00
kobil_sct.h
Makefile USB: oti6858 usb-serial driver (in Nokia CA-42 cable) 2007-07-12 16:29:47 -07:00
Makefile-keyspan_pda_fw
mct_u232.c USB: mct_u232: Convert to proper speed handling API 2007-07-30 13:27:46 -07:00
mct_u232.h USB: mct_u232: Convert to proper speed handling API 2007-07-30 13:27:46 -07:00
mos7720.c USB: mos7720, mos7840: remove redundant urb check 2007-07-19 17:46:04 -07:00
mos7840.c USB: mos7720, mos7840: remove redundant urb check 2007-07-19 17:46:04 -07:00
navman.c USB: serial: navman: clean up urb->status usage 2007-07-12 16:34:35 -07:00
omninet.c USB: serial: omninet: clean up urb->status usage 2007-07-12 16:34:35 -07:00
option.c USB: fix support for Dell Wireless Broadband (aka WWAN) 2007-08-22 14:27:44 -07:00
oti6858.c USB: serial: oti6858: clean up urb->status usage 2007-07-12 16:34:36 -07:00
oti6858.h USB: oti6858 usb-serial driver (in Nokia CA-42 cable) 2007-07-12 16:29:47 -07:00
pl2303.c USB: pl2303: remove bogus checks and fix speed support to use tty_get_baud_rate() 2007-07-12 16:34:41 -07:00
pl2303.h USB: PL2303: Willcom WS002IN Support. 2007-02-16 15:32:17 -08:00
safe_serial.c USB: Typo: "USB_SAFE_PADDED" -> "USB_SERIAL_SAFE_PADDED". 2007-08-22 14:27:44 -07:00
sierra.c USB: drivers/usb/serial/sierra.c: make 3 functions static 2007-07-30 13:27:46 -07:00
ti_fw_3410.h
ti_fw_5052.h
ti_usb_3410_5052.c USB: serial: ti_usb_3410_5052: clean up urb->status usage 2007-07-12 16:34:36 -07:00
ti_usb_3410_5052.h usb-serial: ti_usb, TI ez430 development tool ID 2006-12-01 14:23:30 -08:00
usb_debug.c USB: add driver for the USB debug devices 2006-12-01 14:25:52 -08:00
usb-serial.c USB: fix BUG: sleeping function called from invalid context at /home/jeremy/hg/xen/paravirt/linux/drivers/usb/core/urb.c:524, in_atomic():1, irqs_disabled():0 2007-07-30 13:27:46 -07:00
visor.c USB: visor add ACER S10 palm device id 2007-08-22 14:27:43 -07:00
visor.h USB: visor add ACER S10 palm device id 2007-08-22 14:27:43 -07:00
whiteheat_fw.h
whiteheat.c USB: visor and whiteheat: remove bogus termios change checks 2007-07-12 16:34:41 -07:00
whiteheat.h USB: whiteheat: Convert to generic boolean 2007-04-27 13:28:39 -07:00
xircom_pgs_fw.h
xircom_pgs.S