Page MenuHomeFreeBSD

D6518.id16762.diff
No OneTemporary

D6518.id16762.diff

Index: sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
===================================================================
--- sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
+++ sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
@@ -321,24 +321,34 @@
wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t);
}
-static void
+static int
vmbus_dma_alloc(struct vmbus_softc *sc)
{
int cpu;
CPU_FOREACH(cpu) {
+ void *ptr;
+
/*
* Per-cpu messages and event flags.
*/
- VMBUS_PCPU_GET(sc, message, cpu) = hyperv_dmamem_alloc(
- bus_get_dma_tag(sc->vmbus_dev), PAGE_SIZE, 0, PAGE_SIZE,
+ ptr = hyperv_dmamem_alloc(bus_get_dma_tag(sc->vmbus_dev),
+ PAGE_SIZE, 0, PAGE_SIZE,
VMBUS_PCPU_PTR(sc, message_dma, cpu),
BUS_DMA_WAITOK | BUS_DMA_ZERO);
- VMBUS_PCPU_GET(sc, event_flag, cpu) = hyperv_dmamem_alloc(
- bus_get_dma_tag(sc->vmbus_dev), PAGE_SIZE, 0, PAGE_SIZE,
+ if (ptr == NULL)
+ return ENOMEM;
+ VMBUS_PCPU_GET(sc, message, cpu) = ptr;
+
+ ptr = hyperv_dmamem_alloc(bus_get_dma_tag(sc->vmbus_dev),
+ PAGE_SIZE, 0, PAGE_SIZE,
VMBUS_PCPU_PTR(sc, event_flag_dma, cpu),
BUS_DMA_WAITOK | BUS_DMA_ZERO);
+ if (ptr == NULL)
+ return ENOMEM;
+ VMBUS_PCPU_GET(sc, event_flag, cpu) = ptr;
}
+ return 0;
}
static void
@@ -622,7 +632,9 @@
/*
* Allocate DMA stuffs.
*/
- vmbus_dma_alloc(sc);
+ ret = vmbus_dma_alloc(sc);
+ if (ret != 0)
+ goto cleanup;
if (bootverbose)
printf("VMBUS: Calling smp_rendezvous, smp_started = %d\n",

File Metadata

Mime Type
text/plain
Expires
Mon, Feb 16, 1:25 PM (14 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28779186
Default Alt Text
D6518.id16762.diff (1 KB)

Event Timeline