summary refs log tree commit diff stats
path: root/scripts/qapi/types.py
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2018-11-11 09:40:23 +0000
committerKevin Wolf <kwolf@redhat.com>2018-11-19 12:51:22 +0100
commit441f6692ecc14859b77af2ac6d8f55e6f1354d3b (patch)
treeb85ca63dbe2421608c99188560f23dcdfa5bdfaa /scripts/qapi/types.py
parent5e3c0220d7e4f0361c4d36c697a8842f2b583402 (diff)
downloadfocaccia-qemu-441f6692ecc14859b77af2ac6d8f55e6f1354d3b.tar.gz
focaccia-qemu-441f6692ecc14859b77af2ac6d8f55e6f1354d3b.zip
fdc: fix segfault in fdctrl_stop_transfer() when DMA is disabled
Commit c8a35f1cf0f "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>
Diffstat (limited to 'scripts/qapi/types.py')
0 files changed, 0 insertions, 0 deletions