From 0ba12ebf7c0f0b2348ce116e20a1e58c9877b5f0 Mon Sep 17 00:00:00 2001 From: Dan Aloni Date: Thu, 8 Sep 2022 17:08:51 +0300 Subject: [PATCH] Revert "SUNRPC: Remove unreachable error condition" This reverts commit 079b1b1bf67d57d3af767492ba7684e4bd2eb5c2. The assumption that it is impossible to return an ERR pointer from rpc_run_task() no longer holds due to commit 4c22bccac1fd ("SUNRPC: Handle allocation failure in rpc_new_task()"). Fixes: 4c22bccac1fd ('SUNRPC: Handle allocation failure in rpc_new_task()') Fixes: 079b1b1bf67d ('SUNRPC: Remove unreachable error condition') Signed-off-by: Dan Aloni Signed-off-by: Trond Myklebust --- net/sunrpc/clnt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 7d268a291486b..c284efa3d1efc 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -2873,6 +2873,9 @@ int rpc_clnt_test_and_add_xprt(struct rpc_clnt *clnt, task = rpc_call_null_helper(clnt, xprt, NULL, RPC_TASK_ASYNC, &rpc_cb_add_xprt_call_ops, data); + if (IS_ERR(task)) + return PTR_ERR(task); + data->xps->xps_nunique_destaddr_xprts++; rpc_put_task(task); success: -- 2.39.5