[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 1/3] ioemu: check mmap return value when mapping MSI-x table
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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |