Skip to content

Commit

Permalink
staging: hv: Fix error checking in channel.c
Browse files Browse the repository at this point in the history
Fixed errors in return value checking code, which caused vmbus channel
not functioning.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Cc: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Haiyang Zhang authored and Greg Kroah-Hartman committed May 14, 2010
1 parent 3dfe08e commit fd4dc88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/hv/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,13 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize,
RecvRingBufferSize) >> PAGE_SHIFT;

ret = RingBufferInit(&NewChannel->Outbound, out, SendRingBufferSize);
if (!ret) {
if (ret != 0) {
err = ret;
goto errorout;
}

ret = RingBufferInit(&NewChannel->Inbound, in, RecvRingBufferSize);
if (!ret) {
if (ret != 0) {
err = ret;
goto errorout;
}
Expand All @@ -228,7 +228,7 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize,
RecvRingBufferSize,
&NewChannel->RingBufferGpadlHandle);

if (!ret) {
if (ret != 0) {
err = ret;
goto errorout;
}
Expand Down Expand Up @@ -569,7 +569,7 @@ int VmbusChannelEstablishGpadl(struct vmbus_channel *Channel, void *Kbuffer,
ret = VmbusPostMessage(gpadlBody,
subMsgInfo->MessageSize -
sizeof(*subMsgInfo));
if (!ret)
if (ret != 0)
goto Cleanup;

}
Expand Down

0 comments on commit fd4dc88

Please sign in to comment.