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

Staging: hv: test return value of VmbusChannelEstablishGpadl()

The return value of VmbusChannelEstablishGpadl() was not examined in
Channel.c
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 99259159
...@@ -175,7 +175,7 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize, ...@@ -175,7 +175,7 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize,
void (*OnChannelCallback)(void *context), void *Context) void (*OnChannelCallback)(void *context), void *Context)
{ {
struct vmbus_channel_open_channel *openMsg; struct vmbus_channel_open_channel *openMsg;
struct vmbus_channel_msginfo *openInfo; struct vmbus_channel_msginfo *openInfo = NULL;
void *in, *out; void *in, *out;
unsigned long flags; unsigned long flags;
int ret, err = 0; int ret, err = 0;
...@@ -218,7 +218,11 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize, ...@@ -218,7 +218,11 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize,
SendRingBufferSize + SendRingBufferSize +
RecvRingBufferSize, RecvRingBufferSize,
&NewChannel->RingBufferGpadlHandle); &NewChannel->RingBufferGpadlHandle);
/* FIXME: the value of ret is not checked */
if (!ret) {
err = ret;
goto errorout;
}
DPRINT_DBG(VMBUS, "channel %p <relid %d gpadl 0x%x send ring %p " DPRINT_DBG(VMBUS, "channel %p <relid %d gpadl 0x%x send ring %p "
"size %d recv ring %p size %d, downstreamoffset %d>", "size %d recv ring %p size %d, downstreamoffset %d>",
...@@ -250,7 +254,6 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize, ...@@ -250,7 +254,6 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize,
openMsg->OpenId = NewChannel->OfferMsg.ChildRelId; /* FIXME */ openMsg->OpenId = NewChannel->OfferMsg.ChildRelId; /* FIXME */
openMsg->ChildRelId = NewChannel->OfferMsg.ChildRelId; openMsg->ChildRelId = NewChannel->OfferMsg.ChildRelId;
openMsg->RingBufferGpadlHandle = NewChannel->RingBufferGpadlHandle; openMsg->RingBufferGpadlHandle = NewChannel->RingBufferGpadlHandle;
ASSERT(openMsg->RingBufferGpadlHandle);
openMsg->DownstreamRingBufferPageOffset = SendRingBufferSize >> openMsg->DownstreamRingBufferPageOffset = SendRingBufferSize >>
PAGE_SHIFT; PAGE_SHIFT;
openMsg->ServerContextAreaGpadlHandle = 0; /* TODO */ openMsg->ServerContextAreaGpadlHandle = 0; /* TODO */
...@@ -295,6 +298,8 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize, ...@@ -295,6 +298,8 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize,
return 0; return 0;
errorout: errorout:
RingBufferCleanup(&NewChannel->Outbound);
RingBufferCleanup(&NewChannel->Inbound);
osd_PageFree(out, (SendRingBufferSize + RecvRingBufferSize) osd_PageFree(out, (SendRingBufferSize + RecvRingBufferSize)
>> PAGE_SHIFT); >> PAGE_SHIFT);
kfree(openInfo); kfree(openInfo);
......
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