Staging: hv: vmbus: Cleanup the error return value in vmbus_recvpacket_raw()
authorK. Y. Srinivasan <kys@microsoft.com>
Thu, 25 Aug 2011 16:48:59 +0000 (09:48 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 25 Aug 2011 22:23:18 +0000 (15:23 -0700)
Use standard Linux errno values.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/channel.c
drivers/staging/hv/hv_mouse.c
drivers/staging/hv/netvsc.c

index 9eb8def22668edd3badb3c1206596285bcf06384..ac92c1f99261e7d1bdaf305478c9961c95d05af7 100644 (file)
@@ -811,7 +811,7 @@ int vmbus_recvpacket_raw(struct vmbus_channel *channel, void *buffer,
                pr_err("Buffer too small - needed %d bytes but "
                        "got space for only %d bytes\n",
                        packetlen, bufferlen);
-               return -2;
+               return -ENOBUFS;
        }
 
        *requestid = desc.trans_id;
index 572717317e71d35ceeb82c71540d9705b0172ed1..d7e24bce4c0d2e2b1b96ad320df6c7ca3411cef4 100644 (file)
@@ -539,7 +539,7 @@ static void mousevsc_on_channel_callback(void *context)
                                }
                                break;
                        }
-               } else if (ret == -2) {
+               } else if (ret == -ENOBUFS) {
                        /* Handle large packet */
                        bufferlen = bytes_recvd;
                        buffer = kzalloc(bytes_recvd, GFP_KERNEL);
index d547ff676a0baa07995aa3d81cb493c7352bb7ec..b89ac7e40ca8e71e4e3371903a0dfa8a6fe39ea4 100644 (file)
@@ -884,7 +884,7 @@ static void netvsc_channel_cb(void *context)
 
                                break;
                        }
-               } else if (ret == -2) {
+               } else if (ret == -ENOBUFS) {
                        /* Handle large packet */
                        buffer = kmalloc(bytes_recvd, GFP_ATOMIC);
                        if (buffer == NULL) {