Commit 80d11b2a authored by Bill Pemberton's avatar Bill Pemberton Committed by Greg Kroah-Hartman

Staging: hv: test return value of osd_WaitEventCreate()

The return value of osd_WaitEventCreate() was not examined in some
places.
Signed-off-by: default avatarBill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8cad0af9
......@@ -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;
......
......@@ -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,
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment