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

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

index f26886d7738bb5cbd07fa031edd72000408cde61..f5f3052e32bf264878ae601e3b39467c1e75eeab 100644 (file)
@@ -511,7 +511,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
                        RNDIS_MESSAGE_SIZE(struct rndis_set_request) +
                        sizeof(u32));
        if (!request) {
-               ret = -1;
+               ret = -ENOMEM;
                goto Cleanup;
        }
 
@@ -531,7 +531,6 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
        t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
 
        if (t == 0) {
-               ret = -1;
                dev_err(&dev->net_dev->dev->device,
                        "timeout before we got a set response...\n");
                /*
@@ -540,8 +539,6 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
                 */
                goto Exit;
        } else {
-               if (ret > 0)
-                       ret = 0;
                set_complete = &request->response_msg.msg.set_complete;
                status = set_complete->status;
        }