Commit fd4dc88e authored by Haiyang Zhang's avatar Haiyang Zhang Committed by Greg Kroah-Hartman

staging: hv: Fix error checking in channel.c

Fixed errors in return value checking code, which caused vmbus channel
not functioning.
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Cc: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3dfe08e6
...@@ -204,13 +204,13 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize, ...@@ -204,13 +204,13 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize,
RecvRingBufferSize) >> PAGE_SHIFT; RecvRingBufferSize) >> PAGE_SHIFT;
ret = RingBufferInit(&NewChannel->Outbound, out, SendRingBufferSize); ret = RingBufferInit(&NewChannel->Outbound, out, SendRingBufferSize);
if (!ret) { if (ret != 0) {
err = ret; err = ret;
goto errorout; goto errorout;
} }
ret = RingBufferInit(&NewChannel->Inbound, in, RecvRingBufferSize); ret = RingBufferInit(&NewChannel->Inbound, in, RecvRingBufferSize);
if (!ret) { if (ret != 0) {
err = ret; err = ret;
goto errorout; goto errorout;
} }
...@@ -228,7 +228,7 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize, ...@@ -228,7 +228,7 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize,
RecvRingBufferSize, RecvRingBufferSize,
&NewChannel->RingBufferGpadlHandle); &NewChannel->RingBufferGpadlHandle);
if (!ret) { if (ret != 0) {
err = ret; err = ret;
goto errorout; goto errorout;
} }
...@@ -569,7 +569,7 @@ int VmbusChannelEstablishGpadl(struct vmbus_channel *Channel, void *Kbuffer, ...@@ -569,7 +569,7 @@ int VmbusChannelEstablishGpadl(struct vmbus_channel *Channel, void *Kbuffer,
ret = VmbusPostMessage(gpadlBody, ret = VmbusPostMessage(gpadlBody,
subMsgInfo->MessageSize - subMsgInfo->MessageSize -
sizeof(*subMsgInfo)); sizeof(*subMsgInfo));
if (!ret) if (ret != 0)
goto Cleanup; goto Cleanup;
} }
......
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