[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/11] ahci: Do not unmap NULL addresses
From: |
John Snow |
Subject: |
[Qemu-devel] [PULL 08/11] ahci: Do not unmap NULL addresses |
Date: |
Wed, 10 Feb 2016 14:38:06 -0500 |
Definitely don't try to unmap a garbage address.
Reported-by: Zuozhi fzz <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden
---
hw/ide/ahci.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 7e87b18..3a95dad 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -662,6 +662,10 @@ static bool ahci_map_fis_address(AHCIDevice *ad)
static void ahci_unmap_fis_address(AHCIDevice *ad)
{
+ if (ad->res_fis == NULL) {
+ DPRINTF(ad->port_no, "Attempt to unmap NULL FIS address\n");
+ return;
+ }
dma_memory_unmap(ad->hba->as, ad->res_fis, 256,
DMA_DIRECTION_FROM_DEVICE, 256);
ad->res_fis = NULL;
@@ -678,6 +682,10 @@ static bool ahci_map_clb_address(AHCIDevice *ad)
static void ahci_unmap_clb_address(AHCIDevice *ad)
{
+ if (ad->lst == NULL) {
+ DPRINTF(ad->port_no, "Attempt to unmap NULL CLB address\n");
+ return;
+ }
dma_memory_unmap(ad->hba->as, ad->lst, 1024,
DMA_DIRECTION_FROM_DEVICE, 1024);
ad->lst = NULL;
--
2.4.3
- [Qemu-devel] [PULL 01/11] ide: Prohibit RESET on IDE drives, (continued)
- [Qemu-devel] [PULL 01/11] ide: Prohibit RESET on IDE drives, John Snow, 2016/02/10
- [Qemu-devel] [PULL 00/11] Ide patches, John Snow, 2016/02/10
- [Qemu-devel] [PULL 03/11] ide: move buffered DMA cancel to core, John Snow, 2016/02/10
- [Qemu-devel] [PULL 04/11] ide: replace blk_drain_all by blk_drain, John Snow, 2016/02/10
- [Qemu-devel] [PULL 02/11] ide: code motion, John Snow, 2016/02/10
- [Qemu-devel] [PULL 05/11] ide: Add silent DRQ cancellation, John Snow, 2016/02/10
- [Qemu-devel] [PULL 06/11] ide: fix device_reset to not ignore pending AIO, John Snow, 2016/02/10
- [Qemu-devel] [PULL 07/11] fdc: always compile-check debug prints, John Snow, 2016/02/10
- [Qemu-devel] [PULL 10/11] ahci: explicitly reject bad engine states on post_load, John Snow, 2016/02/10
- [Qemu-devel] [PULL 08/11] ahci: Do not unmap NULL addresses,
John Snow <=
- [Qemu-devel] [PULL 09/11] ahci: handle LIST_ON and FIS_ON in map helpers, John Snow, 2016/02/10
- [Qemu-devel] [PULL 11/11] ahci: prohibit "restarting" the FIS or CLB engines, John Snow, 2016/02/10