Skip to content

Commit

Permalink
SUNRPC: Remove unreachable error condition
Browse files Browse the repository at this point in the history
rpc_clnt_test_and_add_xprt() invokes rpc_call_null_helper(), which
return the value of rpc_run_task() to "task". Since rpc_run_task() is
impossible to return an ERR pointer, there is no need to add the
IS_ERR() condition on "task" here. So we need to remove it.

Fixes: 7f55489 ("SUNRPC: Allow addition of new transports to a struct rpc_clnt")
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
  • Loading branch information
sherlly authored and Trond Myklebust committed Apr 21, 2020
1 parent 7648f93 commit efe57fd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/sunrpc/clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2808,8 +2808,7 @@ int rpc_clnt_test_and_add_xprt(struct rpc_clnt *clnt,
task = rpc_call_null_helper(clnt, xprt, NULL,
RPC_TASK_SOFT|RPC_TASK_SOFTCONN|RPC_TASK_ASYNC|RPC_TASK_NULLCREDS,
&rpc_cb_add_xprt_call_ops, data);
if (IS_ERR(task))
return PTR_ERR(task);

rpc_put_task(task);
success:
return 1;
Expand Down

0 comments on commit efe57fd

Please sign in to comment.