linux/drivers
Ezequiel Garcia 8ad116e649 ata: sata_mv: Cleanup only the initialized ports
When an error occurs in the port initialization loop, currently the
driver tries to cleanup all the ports. This results in a NULL pointer
dereference if the ports were only partially initialized.

Fix this by updating only the number of initialized ports (either
with failure or successfully), before jumping to the error path
and looping over that number in the cleanup loop.

Cc: Andrew Lunn <andrew@lunn.ch>
Reported-by: Mikael Pettersson <mikpelinux@gmail.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org
2014-02-16 11:51:17 -05:00
..
accessibility
acpi ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
amba
ata ata: sata_mv: Cleanup only the initialized ports 2014-02-16 11:51:17 -05:00
atm
auxdisplay
base regmap: Updates for v3.14 2014-01-25 13:18:00 -08:00
bcma
block Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2014-01-28 11:02:23 -08:00
bluetooth
bus
cdrom
char Merge branch 'ipmi' (ipmi patches from Corey Minyard) 2014-01-25 15:33:41 -08:00
clk The second half of the clock framework pull requeust for 3.14 is 2014-01-28 18:44:53 -08:00
clocksource ARM: SoC DT updates for 3.14 2014-01-23 18:45:38 -08:00
connector
cpufreq Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2014-01-24 17:13:49 -08:00
cpuidle
crypto ARM: driver updates for 3.14 2014-01-23 18:49:36 -08:00
dca
devfreq ARM: SoC cleanups for 3.14 2014-01-23 18:36:55 -08:00
dio
dma ARM: SoC DT updates for 3.14 2014-01-23 18:45:38 -08:00
edac Merge branch 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-01-20 12:10:27 -08:00
eisa Revert "EISA: Initialize device before its resources" 2014-01-17 14:57:29 -07:00
extcon
firewire firewire: Enable remote DMA above 4 GB 2014-01-20 01:11:13 +01:00
firmware firmware/google: drop 'select EFI' to avoid recursive dependency 2014-01-27 21:02:40 -08:00
fmc
gpio ARM: driver updates for 3.14 2014-01-23 18:49:36 -08:00
gpu ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
hid ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
hsi
hv ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
hwmon Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2014-01-24 17:13:49 -08:00
hwspinlock
i2c ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
ide ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
idle ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
iio Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-01-22 21:21:55 -08:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2014-01-24 17:17:30 -08:00
iommu ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
ipack
irqchip Xtensa patchset for 3.14-rc1 2014-01-25 10:49:30 -08:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
leds Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds 2014-01-28 18:53:01 -08:00
lguest
macintosh Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2014-01-27 21:11:26 -08:00
mailbox drivers/mailbox/omap: make mbox->irq signed for error handling 2014-01-23 16:36:53 -08:00
md md updates for 3.14 2014-01-24 17:41:50 -08:00
media Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
memory
memstick drivers/memstick/host/rtsx_pci_ms.c: fix ms card data transfer bug 2014-01-23 16:37:04 -08:00
message MPT / PCI: Use pci_stop_and_remove_bus_device_locked() 2014-01-14 12:14:25 -07:00
mfd regulator: Updates for v3.14 2014-01-25 13:19:10 -08:00
misc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-01-22 21:21:55 -08:00
mmc MMC highlights for 3.14: 2014-01-26 11:00:41 -08:00
mtd MTD updates for 3.14: 2014-01-28 18:56:37 -08:00
net Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2014-01-27 21:11:26 -08:00
nfc
ntb
nubus
of Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
oprofile
parisc
parport TTY/Serial driver patches for 3.14-rc1 2014-01-20 16:05:23 -08:00
pci ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
pcmcia PCI changes for the v3.14 merge window: 2014-01-22 16:39:28 -08:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
pinctrl ARM: SoC DT updates for 3.14 2014-01-23 18:45:38 -08:00
platform ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
pnp Merge branch 'pnp' 2014-01-12 23:48:18 +01:00
power Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
powercap
pps
ps3
ptp ptp_pch: Add dependency on HAS_IOMEM 2014-01-15 14:51:22 -08:00
pwm pwm: Changes for v3.14-rc1 2014-01-27 08:15:51 -08:00
rapidio
regulator regulator: Updates for v3.14 2014-01-25 13:19:10 -08:00
remoteproc
reset
rpmsg
rtc Merge branch 'akpm' (incoming from Andrew) 2014-01-23 19:11:50 -08:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2014-01-28 09:02:24 -08:00
sbus
scsi Main batch of InfiniBand/RDMA changes for 3.14: 2014-01-24 17:18:32 -08:00
sfi
sh
sn
spi spi: Updates for v3.14 2014-01-25 13:20:36 -08:00
ssb
staging Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
target
tc
thermal Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2014-01-24 17:13:49 -08:00
tty Serial fixes for 3.14-rc1 2014-01-28 18:50:24 -08:00
uio
usb ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
uwb
vfio Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2014-01-27 21:11:26 -08:00
vhost
video pwm: Changes for v3.14-rc1 2014-01-27 08:15:51 -08:00
virt
virtio A few simple fixes. Quiet cycle. 2014-01-22 22:24:35 -08:00
vlynq drivers/vlynq/vlynq.c: fix another resource size off by 1 error 2014-01-23 16:36:55 -08:00
vme
w1 drivers/w1/masters/w1-gpio.c: add strong pullup emulation 2014-01-23 16:37:04 -08:00
watchdog ARM: driver updates for 3.14 2014-01-23 18:49:36 -08:00
xen ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
zorro
Kconfig
Makefile