qemu-e2k/hw
Mark Cave-Ayland 441f6692ec fdc: fix segfault in fdctrl_stop_transfer() when DMA is disabled
Commit c8a35f1cf0 "fdc: use IsaDma interface instead of global DMA_*
functions" accidentally introduced a segfault in fdctrl_stop_transfer() for
non-DMA transfers.

If fdctrl->dma_chann has not been configured then the fdctrl->dma interface
reference isn't initialised during isabus_fdc_realize(). Unfortunately
fdctrl_stop_transfer() unconditionally references the DMA interface when
finishing the transfer causing a NULL pointer dereference.

Fix the issue by adding a check in fdctrl_stop_transfer() so that the DMA
interface reference and release method is only invoked if fdctrl->dma_chann
has been set.

(This issue was discovered by Martin testing a recent change in the NetBSD
installer under qemu-system-sparc)

Cc: qemu-stable@nongnu.org
Reported-by: Martin Husemann <martin@duskware.de>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-11-19 12:51:22 +01:00
..
9pfs
acpi
adc
alpha
arm
audio
block fdc: fix segfault in fdctrl_stop_transfer() when DMA is disabled 2018-11-19 12:51:22 +01:00
bt
char
core
cpu
cris
display
dma
gpio
hppa
hyperv
i2c
i386
ide
input
intc
ipack
ipmi
isa
lm32
m68k
mem
microblaze
mips
misc
moxie
net
nios2
nvram
openrisc
pci
pci-bridge
pci-host
pcmcia
ppc
rdma
riscv
s390x
scsi
sd
sh4
smbios
sparc
sparc64
ssi
timer
tpm
tricore
unicore32
usb
vfio
virtio
watchdog
xen
xenpv
xtensa
Makefile.objs