android_kernel_xiaomi_sm8350/drivers
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
..
acorn
acpi PM: Introduce pm_power_off_prepare 2007-07-19 10:04:42 -07:00
amba
ata PCMCIA: Add another MemoryCard to ide-cs/pata_pcmcia 2007-07-20 01:11:53 +02:00
atm [ATM]: nicstar needs virt_to_bus 2007-07-18 02:13:42 -07:00
auxdisplay
base PM: Do not require dev spew to get PM_DEBUG 2007-07-19 10:04:42 -07:00
block lguest: the block driver 2007-07-19 10:04:53 -07:00
bluetooth
cdrom
char random: fix bound check ordering (CVE-2007-3105) 2007-07-19 14:21:04 -07:00
clocksource
connector
cpufreq
crypto
dio
dma
edac drivers/edac: fix edac_device sysfs corner case bug 2007-07-19 10:04:57 -07:00
eisa
fc4
firewire firewire: fw-sbp2: convert to new SCSI data buffer accessors 2007-07-18 23:53:28 +02:00
firmware
hid
hwmon Merge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6 2007-07-19 14:24:57 -07:00
i2c Merge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6 2007-07-19 14:24:57 -07:00
ide ide: add support for SCSI ioctls to ide-floppy 2007-07-20 01:11:59 +02:00
ieee1394
infiniband some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
input some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
isdn isdn/sc: compile breakage re check_reset() 2007-07-19 10:04:50 -07:00
kvm i386: Allow KVM on i386 nonpae 2007-07-19 14:37:05 -07:00
leds
lguest lguest: the Makefile and Kconfig 2007-07-19 10:04:52 -07:00
macintosh some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
mca
md some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
media some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
message
mfd some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
misc some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
mmc some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
mtd UBI: fix compile warning 2007-07-18 16:59:17 +03:00
net Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2007-07-19 10:23:21 -07:00
nubus some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
oprofile
parisc serial: add early_serial_setup() back to header file 2007-07-18 08:38:22 -07:00
parport some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
pci some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
pcmcia PM: remove deprecated dpm_runtime_* routines 2007-07-18 15:49:49 -07:00
pnp some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
power
ps3
rapidio some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
rtc RTC: add periodic irq support to rtc-cmos 2007-07-19 10:04:52 -07:00
s390 some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
sbus some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
scsi some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
serial some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
sh some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
sn some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
spi
tc zs: move to the serial subsystem 2007-07-18 08:38:22 -07:00
telephony some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
uio UIO: Hilscher CIF card driver 2007-07-18 15:57:16 -07:00
usb USB: Remove pointless conditional in drivers/usb/serial/io_ti.c::edge_shutdown() 2007-07-19 17:46:05 -07:00
video Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild 2007-07-19 14:28:19 -07:00
w1 some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
xen xen: add the Xenbus sysfs and virtual device hotplug driver 2007-07-18 08:47:45 -07:00
zorro
Kconfig lguest: the Makefile and Kconfig 2007-07-19 10:04:52 -07:00
Makefile lguest: the Makefile and Kconfig 2007-07-19 10:04:52 -07:00