From 607679428d13d33f5f9c5e3e674d43c2fec7d7cc Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Wed, 5 May 2010 15:27:33 -0400 Subject: [PATCH] --- yaml --- r: 197291 b: refs/heads/master c: 80d11b2ae26543656f7226b44ed9d6a184766e85 h: refs/heads/master i: 197289: 7d2eb02b322c0bffd98396fc695a8f0a301af4aa 197287: fb942ac2677261d2102f36b076614e566f3e7d6c v: v3 --- [refs] | 2 +- trunk/drivers/staging/hv/Connection.c | 5 +++++ trunk/drivers/staging/hv/NetVsc.c | 4 ++++ trunk/drivers/staging/hv/StorVsc.c | 10 +++++++++- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 65ec1da0b45c..1254898f8430 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8cad0af9a1a1882cd00f12f8f7c79690f563b1d7 +refs/heads/master: 80d11b2ae26543656f7226b44ed9d6a184766e85 diff --git a/trunk/drivers/staging/hv/Connection.c b/trunk/drivers/staging/hv/Connection.c index 1e4111412ab6..e590eb4b6e76 100644 --- a/trunk/drivers/staging/hv/Connection.c +++ b/trunk/drivers/staging/hv/Connection.c @@ -98,6 +98,11 @@ int VmbusConnect(void) } msgInfo->WaitEvent = osd_WaitEventCreate(); + if (!msgInfo->WaitEvent) { + ret = -ENOMEM; + goto Cleanup; + } + msg = (struct vmbus_channel_initiate_contact *)msgInfo->Msg; msg->Header.MessageType = ChannelMessageInitiateContact; diff --git a/trunk/drivers/staging/hv/NetVsc.c b/trunk/drivers/staging/hv/NetVsc.c index 27516d40b6ed..d3154e711776 100644 --- a/trunk/drivers/staging/hv/NetVsc.c +++ b/trunk/drivers/staging/hv/NetVsc.c @@ -749,6 +749,10 @@ static int NetVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo) &netDevice->ReceivePacketList); } netDevice->ChannelInitEvent = osd_WaitEventCreate(); + if (!netDevice->ChannelInitEvent) { + ret = -ENOMEM; + goto Cleanup; + } /* Open the channel */ ret = Device->Driver->VmbusChannelInterface.Open(Device, diff --git a/trunk/drivers/staging/hv/StorVsc.c b/trunk/drivers/staging/hv/StorVsc.c index 7372317fe836..4d0fbce229e2 100644 --- a/trunk/drivers/staging/hv/StorVsc.c +++ b/trunk/drivers/staging/hv/StorVsc.c @@ -199,6 +199,10 @@ static int StorVscChannelInit(struct hv_device *Device) */ memset(request, 0, sizeof(struct storvsc_request_extension)); request->WaitEvent = osd_WaitEventCreate(); + if (!request->WaitEvent) { + ret = -ENOMEM; + goto nomem; + } vstorPacket->Operation = VStorOperationBeginInitialization; vstorPacket->Flags = REQUEST_COMPLETION_FLAG; @@ -338,7 +342,7 @@ static int StorVscChannelInit(struct hv_device *Device) Cleanup: kfree(request->WaitEvent); request->WaitEvent = NULL; - +nomem: PutStorDevice(Device); DPRINT_EXIT(STORVSC); @@ -649,6 +653,10 @@ int StorVscOnHostReset(struct hv_device *Device) vstorPacket = &request->VStorPacket; request->WaitEvent = osd_WaitEventCreate(); + if (!request->WaitEvent) { + ret = -ENOMEM; + goto Cleanup; + } vstorPacket->Operation = VStorOperationResetBus; vstorPacket->Flags = REQUEST_COMPLETION_FLAG;