Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145061745
D6518.id16762.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D6518.id16762.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D6518: hyperv/vmbus: Check hyperv_dmamem_alloc return value
Attached
Detach File
Event Timeline
Log In to Comment