WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 1/3] ioemu: check mmap return value when mapping MSI-

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 1/3] ioemu: check mmap return value when mapping MSI-x table
From: Yu Zhao <yu.zhao@xxxxxxxxx>
Date: Sat, 24 Jan 2009 12:47:08 +0800
Cc: Yu Zhao <yu.zhao@xxxxxxxxx>
Delivery-date: Fri, 23 Jan 2009 20:51:15 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Signed-off-by: Yu Zhao <yu.zhao@xxxxxxxxx>
---
 hw/pt-msi.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index c515c02..4f25186 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -322,6 +322,12 @@ int pt_msix_init(struct pt_dev *dev, int pos)
     dev->msix->phys_iomem_base = mmap(0, total_entries * 16,
                           PROT_WRITE | PROT_READ, MAP_SHARED | MAP_LOCKED,
                           dev->msix->fd, dev->msix->table_base + table_off);
+    if ( dev->msix->phys_iomem_base == MAP_FAILED )
+    {
+        PT_LOG("Can't map physical MSI-X table: %s\n", strerror(errno));
+        return -1;
+    }
+
     PT_LOG("mapping physical MSI-X table to %lx\n",
            (unsigned long)dev->msix->phys_iomem_base);
     return 0;
-- 
1.5.6.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>