* [Qemu-devel] [PATCH] ahci: Fix crashes on duplicate BH registration
@ 2011-05-09 15:48 Jan Kiszka
2011-05-10 10:14 ` Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2011-05-09 15:48 UTC (permalink / raw)
To: Alexander Graf, Kevin Wolf; +Cc: qemu-devel
If ahci_dma_set_inactive is called a while there is still a pending BH
from a previous run, we will crash on the second run of
ahci_check_cmd_bh as it overwrites AHCIDevice::check_bh. Avoid this
broken and redundant duplicate registration.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
hw/ide/ahci.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index c6e0c77..744d19d 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1066,9 +1066,11 @@ static int ahci_dma_set_inactive(IDEDMA *dma)
ad->dma_cb = NULL;
- /* maybe we still have something to process, check later */
- ad->check_bh = qemu_bh_new(ahci_check_cmd_bh, ad);
- qemu_bh_schedule(ad->check_bh);
+ if (!ad->check_bh) {
+ /* maybe we still have something to process, check later */
+ ad->check_bh = qemu_bh_new(ahci_check_cmd_bh, ad);
+ qemu_bh_schedule(ad->check_bh);
+ }
return 0;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] ahci: Fix crashes on duplicate BH registration
2011-05-09 15:48 [Qemu-devel] [PATCH] ahci: Fix crashes on duplicate BH registration Jan Kiszka
@ 2011-05-10 10:14 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2011-05-10 10:14 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Alexander Graf, qemu-devel
Am 09.05.2011 17:48, schrieb Jan Kiszka:
> If ahci_dma_set_inactive is called a while there is still a pending BH
> from a previous run, we will crash on the second run of
> ahci_check_cmd_bh as it overwrites AHCIDevice::check_bh. Avoid this
> broken and redundant duplicate registration.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-10 10:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-09 15:48 [Qemu-devel] [PATCH] ahci: Fix crashes on duplicate BH registration Jan Kiszka
2011-05-10 10:14 ` Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).