staging: hv: Fix error checking in channel.c
authorHaiyang Zhang <haiyangz@microsoft.com>
Thu, 13 May 2010 15:56:30 +0000 (15:56 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 14 May 2010 20:57:56 +0000 (13:57 -0700)
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>
drivers/staging/hv/channel.c

index 12c351e16360f75d767028e8a2959ce5a606f8af..f047c5a7f64c1c35e7eed64b9818906e6f95885d 100644 (file)
@@ -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;
        }
@@ -228,7 +228,7 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize,
                                         RecvRingBufferSize,
                                         &NewChannel->RingBufferGpadlHandle);
 
-       if (!ret) {
+       if (ret != 0) {
                err = ret;
                goto errorout;
        }
@@ -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;
 
                }