diff options
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r-- | net/sunrpc/clnt.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index dfeea4fea95a..a323abc7ea85 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -466,10 +466,9 @@ int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) | |||
466 | 466 | ||
467 | BUG_ON(flags & RPC_TASK_ASYNC); | 467 | BUG_ON(flags & RPC_TASK_ASYNC); |
468 | 468 | ||
469 | status = -ENOMEM; | ||
470 | task = rpc_new_task(clnt, flags, &rpc_default_ops, NULL); | 469 | task = rpc_new_task(clnt, flags, &rpc_default_ops, NULL); |
471 | if (task == NULL) | 470 | if (task == NULL) |
472 | goto out; | 471 | return -ENOMEM; |
473 | 472 | ||
474 | /* Mask signals on RPC calls _and_ GSS_AUTH upcalls */ | 473 | /* Mask signals on RPC calls _and_ GSS_AUTH upcalls */ |
475 | rpc_task_sigmask(task, &oldset); | 474 | rpc_task_sigmask(task, &oldset); |
@@ -478,15 +477,17 @@ int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) | |||
478 | 477 | ||
479 | /* Set up the call info struct and execute the task */ | 478 | /* Set up the call info struct and execute the task */ |
480 | status = task->tk_status; | 479 | status = task->tk_status; |
481 | if (status == 0) { | 480 | if (status != 0) { |
482 | atomic_inc(&task->tk_count); | 481 | rpc_release_task(task); |
483 | status = rpc_execute(task); | 482 | goto out; |
484 | if (status == 0) | ||
485 | status = task->tk_status; | ||
486 | } | 483 | } |
487 | rpc_restore_sigmask(&oldset); | 484 | atomic_inc(&task->tk_count); |
488 | rpc_release_task(task); | 485 | status = rpc_execute(task); |
486 | if (status == 0) | ||
487 | status = task->tk_status; | ||
488 | rpc_put_task(task); | ||
489 | out: | 489 | out: |
490 | rpc_restore_sigmask(&oldset); | ||
490 | return status; | 491 | return status; |
491 | } | 492 | } |
492 | 493 | ||