linux/drivers/usb/serial
Jesper Juhl 0d46c0079a USB: Remove pointless conditional in drivers/usb/serial/io_ti.c::edge_shutdown()
Coverity scan found (CID: 1708) this in
drivers/usb/serial/io_ti.c::edge_shutdown() :

...
2797 		for (i=0; i < serial->num_ports; ++i) {
2798 			edge_port = usb_get_serial_port_data(serial->port[i]);
2799 			edge_remove_sysfs_attrs(edge_port->port);
2800 			if (edge_port) {
2801 				edge_buf_free(edge_port->ep_out_buf);
2802 				kfree(edge_port);
2803 			}
2804 			usb_set_serial_port_data(serial->port[i], NULL);
2805 		}
...

It's complaining that we dereference 'edge_port' in line 2799 which
makes the test of that pointer against NULL in 2800 pointless, since if
edge_port was actually NULL we'd have crashed already before reaching
line 2800.
Reading the edge_open() function it seems to me that the pointer
returned by usb_get_serial_port_data(serial->port[i]) and stored in
'edge_port' can never actually be NULL here, so the test is entirely
superfluous (even if it could be NULL it would be pointless here,
ignoring the then possible crash in that case, since both
edge_buf_free() and kfree() can handle being passed NULL pointers.

This patch removes the pointless conditional (and also makes a few
tiny style corrections now that I was in the area anyway).


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-07-19 17:46:05 -07:00
..
aircable.c USB: serial: aircable: clean up urb->status usage 2007-07-12 16:34:31 -07:00
airprime.c USB: serial: airprime: clean up urb->status usage 2007-07-12 16:34:32 -07:00
ark3116.c USB: serial: ark3116.c: Mixed fixups 2007-07-12 16:34:37 -07:00
belkin_sa.c USB: serial: belkin_sa: Various needed fixes 2007-07-12 16:34:37 -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 USB: CP2101 New Device IDs 2007-04-27 13:28:42 -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
digi_acceleport.c USB: serial: digi_acceleport: clean up urb->status usage 2007-07-12 16:34:32 -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: ftdi_sio: fix oops due to processing workarounds too early 2007-07-12 16:34:40 -07:00
ftdi_sio.h USB: ftdio_sio: New IPlus device ID 2007-06-25 23:38:06 -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: clean up urb->status usage 2007-07-12 16:34:32 -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: io_*: remove bogus termios no change checks 2007-07-12 16:34:41 -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: serial: mct_u232: clean up urb->status usage 2007-07-12 16:34:35 -07:00
mct_u232.h USB: RTS/CTS handshaking support, DTR fixes for MCT U232 serial adapter 2007-07-12 16:29:48 -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: serial: option: clean up urb->status usage 2007-07-12 16:34:36 -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: serial: safe_serial: clean up urb->status usage 2007-07-12 16:34:36 -07:00
sierra.c USB: sierra: Add new devices 2007-07-19 17:46:03 -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 synchronization in usb_serial_put 2007-07-12 16:34:31 -07:00
visor.c USB: visor and whiteheat: remove bogus termios change checks 2007-07-12 16:34:41 -07:00
visor.h USB: remove duplicate device id from visor 2007-02-07 15:44:40 -08: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