Staging: hv: netvsc: Cleanup error return codes in netvsc_device_add()
authorK. Y. Srinivasan <kys@microsoft.com>
Thu, 25 Aug 2011 16:49:16 +0000 (09:49 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 25 Aug 2011 22:32:11 +0000 (15:32 -0700)
Use standard Linux error codes.

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/netvsc.c

index f7f4957ace18c084a91e91461e44309486fd16c0..b6e1fb988d2343983834ae758eb009367be85107 100644 (file)
@@ -918,7 +918,7 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
 
        net_device = alloc_net_device(device);
        if (!net_device) {
-               ret = -1;
+               ret = -ENOMEM;
                goto cleanup;
        }
 
@@ -947,7 +947,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
 
        if (ret != 0) {
                dev_err(&device->device, "unable to open channel: %d", ret);
-               ret = -1;
                goto cleanup;
        }
 
@@ -959,7 +958,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
        if (ret != 0) {
                dev_err(&device->device,
                        "unable to connect to NetVSP - %d", ret);
-               ret = -1;
                goto close;
        }