> -----Mesaj original-----
> De la: dev [mailto:dev-boun...@openvswitch.org] În numele Sairam
> Venugopal
> Trimis: Wednesday, June 22, 2016 2:54 AM
> Către: dev@openvswitch.org
> Subiect: [ovs-dev] [PATCH] datapath-windows: Handle memory allocation
> failure for event creation
>
> Release the lock and return if an event entry fails to get allocated.
>
> Signed-off-by: Sairam Venugopal <vsai...@vmware.com>
> ---
> datapath-windows/ovsext/Event.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/datapath-windows/ovsext/Event.c b/datapath-
> windows/ovsext/Event.c index abf8f0d..f9bea7f 100644
> --- a/datapath-windows/ovsext/Event.c
> +++ b/datapath-windows/ovsext/Event.c
> @@ -134,6 +134,13 @@ OvsPostEvent(POVS_EVENT_ENTRY event)
>
> elem = (POVS_EVENT_QUEUE_ELEM)OvsAllocateMemoryWithTag(
> sizeof(*elem), OVS_EVENT_POOL_TAG);
> +
> + if (elem == NULL) {
> + OVS_LOG_WARN("Fail to allocate memory for event");
> + OvsReleaseEventQueueLock();
> + return;
[Alin Gabriel Serdean: ] maybe continue; instead of return; future allocations
may be successful, but maybe that is me. Otherwise
Acked-by: Alin Gabriel Serdean <aserd...@cloudbasesolutions.com>
> + }
> +
> RtlCopyMemory(&elem->event, event, sizeof elem->event);
> InsertTailList(&queue->elemList, &elem->link);
> queue->numElems++;
> --
> 2.5.0.windows.1
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev